Button

Buttons are interactive elements that trigger actions, allowing users to complete tasks efficiently.

Component checklist

Flutter

Is new design vision part implemented using new tokens?

Up to date

Resources

 

Examples

Buttons/Button


                                                        
                                                        
                                                            OptimusButton(
                                                                          onPressed: () {},
                                                                          size: OptimusWidgetSize.large,
                                                                          variant: OptimusButtonVariant.primary,
                                                                          leadingIcon: OptimusIcons.magic,
                                                                          trailingIcon: OptimusIcons.chevron_right,
                                                                          badgeLabel: 'Badge',
                                                                          child: Text('Button'),
                                                                        ),
                                                                      )
                                                        
                                                            

OptimusButton Example

API

Name

Description

Type

Default

onPressed

The function is going to be called when the button is pressed.

VoidCallback?

 

child

The inner component of the Button.

Widget

 

minWidth

The minimal width of the Button.

double

 

leadingIcon

The leading icon of the Button.

IconData?

 

trailingIcon

The trailing icon of the Button.

IconData?

 

badgeLabel

The text of the Button badge.

String?

 

size

The size of the Button.

OptimusWidgetSize

OptimusWidgetSize.large

variant

The variant of the Button.

OptimusButtonVariant

OptimusButtonVariant.primary