GuideMobile ComponentsHelperFloating Action Button

Floating Action Button

The floating action button (FAB) is used to perform the primary or most common action on a screen.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

FAB Preview

Usage

To implement FAB, you can use this tag FloatingActionButton in the Kotlin file.

    import id.co.biofarma.binduiandroid.components.floating_action_button.FloatingActionButton 
    FloatingActionButton(
        id = "fab_circle_example",
        extended = false,
        type = "solid",
        variant = "primary",
        size = "md",
        onClick = { },
        icon = Icons.Filled.Add,
        position = "right",
        radius = "md",
        label = "PRIMARY",
        disabled = false
    )

Examples

Variant

Set the variant prop to primary , secondary , danger, or neutral for different color.

FAB Variant

Type

Set the type prop to solid, or subtle for different type.

FAB Type

Extended FAB (optional)

Set the extended prop to true, if you would like to change to Extended FAB.

FAB Extended


Props

PropsRequiredDefaultTypedescription
idfalse-stringA unique identifier for the FAB.
labelfalse-stringThe Extended FAB label text.
icontrue-imageVectorFAB icon.
variantfalseprimaryprimary , secondary , danger, neutralThe visual color variant of the FAB.
typefalsesolidsolid , subtleThe visual style of the FAB.
sizefalsemdsm , md, lgThe FAB size.
radiusfalsexsnone , xs, sm, md, lg, fullThe Extended FAB corner radius.
positionfalseleftleft , center , rightFAB Position at the bottom screen left, center, or right.
extendedfalsefalsetrue falseIf true, FAB will be turn to Extended FAB.
disabledfalsefalsetrue falseIf true, FAB will be set to disabled state.
onClickfalse-() -> Unit = {}Callback function to run when the FAB is clicked.
stylefalse-ModifierTo decorate or add behavior to Compose UI elements.
BIND © Biofarma Innovate Next-level Design .