Documentation Index
Fetch the complete documentation index at: https://synapsync.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Button Configuration Classes
The Nebux Design System provides four specialized configuration classes for buttons, allowing you to customize every aspect of button appearance, behavior, and state management.ButtonStyleConfig
Configuration class for button visual styling and appearance. Encapsulates all style-related properties for theNbxButton widget, including variant, colors, border radius, and text styling.
Properties
The visual variant of the button. Available options:
ButtonVariant.filled- Filled button with solid backgroundButtonVariant.outline- Button with border outlineButtonVariant.text- Text-only button with underlineButtonVariant.danger- Danger button with error color
Custom background color for the button. When null, uses the theme’s default color for the selected variant.
Custom border radius for the button corners in logical pixels. When null, defaults to 8.0.
Custom text style for the button text. When null, uses theme typography defaults based on variant.
Custom border configuration for outline buttons. When null, uses default border styling.
Constructor
Methods
Creates a copy of this configuration with specified fields replaced.
Usage Example
ButtonIconConfig
Configuration class for button icons and their styling. Encapsulates all icon-related properties including leading and trailing icons with their respective colors.Properties
Icon to display before the button text (leading icon). When null, no leading icon is shown.
The color of the leading icon. When null, uses the button’s foreground color.
Icon to display after the button text (trailing icon). When null, no trailing icon is shown.
The color of the trailing icon. When null, uses the button’s foreground color.
Constructor
Methods
Creates a copy of this configuration with specified fields replaced.
Usage Example
ButtonLayoutConfig
Configuration class for button layout properties. Encapsulates all layout-related properties including expansion behavior and sizing.Properties
Whether the button should expand to fill available width. When true, button width is set to
double.infinity. When false, button takes only the space needed for its content.Constructor
Methods
Creates a copy of this configuration with specified fields replaced.
Usage Example
ButtonStateConfig
Configuration class for button state management. Encapsulates all state-related properties including loading state, enabled state, and selection state.Properties
Whether to show a loading indicator instead of button text. When true, displays a circular progress indicator and disables the button.
Whether the button is enabled and can respond to user interactions. When false, button appears disabled and
onPressed callback is ignored.Whether the button is in selected state. Primarily affects outline variant buttons by changing background and foreground colors.
Custom color for the loading spinner. When null, the spinner color is automatically derived from the button variant for proper contrast.
Constructor
Methods
Creates a copy of this configuration with specified fields replaced.
Usage Example
Complete Example
Here’s a complete example showing all four configuration classes working together:Related Documentation
- NbxButton Widget - Main button component documentation
- Components Overview - All available components
- Color System - Available color tokens