Floating action buttons

A floating action button (FAB) represents the primary action of a screen.


Page Summary


Specifications references

Accessibility

Please follow accessibility criteria for development

You must define a content description on a FAB via the semanticsLabel attribute so that screen readers are able to announce their goal or action. By default the screen reader will say “floating action”. This does not concern ‘Ods ExtendedFloatingActionButton’ as the text will be localized.

Variants

Regular FAB

Regular FABs are FABs that are not expanded and are a regular size.

FAB light FAB dark

Flutter implementation

To display a regular Floating Action Button in your composable screen, use OdsFloatingActionButton:

return OdsFloatingActionButton(
  onClick: () {},
  icon: const Icon(Icons.add),
  semanticsLabel: 'Add', //Optional
);

Small FAB

A small FAB should be used on smaller screens.

Small FABs can also be used to create visual continuity with other screen elements.

FAB mini light FAB mini dark

Flutter implementation

To display a small FAB in your screen use OdsSmallFloatingActionButton

return OdsSmallFloatingActionButton(
  onClick: () {},
  icon: const Icon(Icons.add),
  semanticsLabel: 'Add', //Optional
);

Large FAB

A large FAB should be used on smaller screens.

Small FABs can also be used to create visual continuity with other screen elements.

FAB mini light FAB mini dark

Flutter implementation

To display a small FAB in your screen use OdsLargeFloatingActionButton

return OdsLargeFloatingActionButton(
  onClick: () {},
  icon: const Icon(Icons.add),
  semanticsLabel: 'Add', //Optional
);

Extended FAB

The extended FAB is wider, and it includes a text label.

FAB extended light FAB extended dark

Flutter implementation

To display an extended FAB, use OdsExtendedFloatingActionButton:

return OdsSmallFloatingActionButton(
  onClick: () {},
  text = "Add",
  icon: const Icon(Icons.add), //Optional
);

Component specific tokens

Soon available