Examples
- Variants
- Icons
- Sizes
- States

Different button styles for varying emphasis levels.
Properties
Required
The variant/style of the button.
The callback to call when the button is pressed.
Content
The text label to display on the button.
The icon to display on the button. (e.g.
PhosphorIconsRegular.plus
)The position of the icon. Only applies when
icon
is provided.The tooltip text to display when over the button.
Adds a caret icon to the button and rotates it based on this boolean value. Useful for dropdown toggles.
Layout
The size of the button.
Whether the button should fill the available width.
The alignment of the content inside the button. Only applies when
isExpanded
is true
.State
Shows a spinning indicator and disables interaction. Useful for async operations.
Applies danger styling (typically red colors) to indicate destructive actions like deletion.
Controls whether the button responds to user interaction. Disabled buttons have reduced opacity and show a forbidden cursor.
Styling
The background color of the button. Overrides theme defaults for custom styling.
The background color when hovering.
The background color when pressed.
The foreground color of all content inside the button (label, icon, caret). Essential when using custom background colors.
Enums
NeoButtonVariant
Different variants/styles of buttons.filled
: Solid fill for high emphasis.outlined
: Border-only for medium emphasis.ghost
: No fill or border initially; fills on hover for low emphasis.link
: Underlined text style for low-emphasis actions and navigation.
NeoButtonSize
small
: Compact size for dense UIs.medium
: Standard size for most cases.
NeoButtonAlignment
start
: Aligns content to the left.center
: Default centering.
NeoButtonIconPosition
leading
: Icon before label.trailing
: Icon after label.
Best Practices
- Width Constraints: When using
isExpanded: true
, always provide width constraints to prevent layout issues by wrapping inExpanded
,ConstrainedBox
,SizedBox
, etc. - Loading States: Use
isLoading: true
for async operations to provide visual feedback and prevent double-taps - Danger Actions: Always use
isDanger: true
for destructive actions like deletion or data loss - Combine with
NeoHaptics
in theonPressed
callback for enhanced user experience on supported devices - Limit the number of primary (filled) buttons per screen to avoid decision paralysis
tooltip
is essential for accessibility when using icon-only buttons, and helpful for providing additional context on any button- Edge case: If no
label
oricon
is provided, the button renders as empty—always provide at least one