Segmented Control

Segmented control allows users to toggle between alternate views of the same content.

Component checklist

Flutter

Is new design vision part implemented using new tokens?

Up to date

Resources

Examples

Forms/Segmented Control


                                                        
                                                        
                                                            OptimusSegmentedControl<String>(
                                                                value: _value,
                                                                label: 'Label',
                                                                size: OptimusWidgetSize.medium,
                                                                maxLines: 1,
                                                                isRequired: true,
                                                                isEnabled: true,
                                                                direction: Axis.horizontal,
                                                                onItemSelected: _handleItemSelected,
                                                                items: widget.options
                                                                    .map((i) => OptimusGroupItem<String>(label: Text(i), value: i))
                                                                    .toList(),
                                                              );           
                                                        
                                                            

OptimusSegmentedControl Example

API

Name

Description

Type

Default

label

 

String?

 

error

 

String?

 

value

 

T

 

direction

 

Axis

Axis.horizontal

maxLines

 

int?

 

size

 

OptimusWidgetSize

OptimusRadioSize.large

isEnabled

 

bool

true

isRequired

 

bool

false

items

 

List<OptimusGroupItem<T>>

 

onItemSelected

 

ValueChanged<T>