Skip to content

Button

A customizable button component that supports various styles, sizes, and states.

The Button widget provides consistent styling and behavior options for different button types. It handles loading states, disabled states, and various customization options.

  • Button Types: Primary, Secondary, Outline, Ghost, Destructive, Social.
  • States: Loading, Disabled.
  • Customizable: Supports icons, colors, sizes, borders, and more.

A button for primary actions.


A button for secondary actions.


A button for destructive actions (e.g., delete).


A button with a border and no background.


A button with no border or background.


A button for social logins or actions.


A button with an icon only.


A button that shows a loading indicator.


A button with an icon before the label.


A button with an icon after the label.


A button with both prefix and suffix icons.


PropertyTypeDescription
labelString?The text to be displayed on the button.
heightdouble?Custom height for the button. If not provided, uses the height defined by buttonSize.
widthdouble?Custom width for the button. If not provided, uses the width defined by buttonSize.
colorColor?Background color of the button. Overrides the default color for the buttonType.
labelColorColor?Text color of the button. Overrides the default color for the buttonType.
onPressedVoidCallback?Callback function when the button is tapped. If null, the button appears disabled.
isLoadingboolWhen true, displays a loading indicator instead of the button content.
labelStyleTextStyle?Custom text style for the button label.
borderBorderSide?Custom border for the button. Overrides the default border for the buttonType.
prefixIconWidget?Widget to display before the button label.
suffixIconWidget?Widget to display after the button label.
buttonTypeButtonTypeDefines the type of button (e.g., primary, secondary, outline, etc.).
buttonSizeButtonSizeDefines the size of the button (e.g., small, medium, large, full).
borderRadiusBorderRadius?Custom border radius for the button.
iconWidget?Icon to display in the button. Overrides the label and prefix/suffix icons.
paddingEdgeInsetsGeometry?Custom padding for the button content.