OudsExtendedFloatingActionButton

fun OudsExtendedFloatingActionButton(label: String, onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = OudsFloatingActionButtonDefaults.shape, appearance: OudsFloatingActionButtonAppearance = OudsFloatingActionButtonDefaults.Appearance, interactionSource: MutableInteractionSource? = null)

Extended FABs help people take primary actions. They're wider than FABs to accommodate a text label and larger target area.

The other extended floating action button overload supports a text label and icon.

Parameters

label

Label displayed inside this FAB.

onClick

Called when this FAB is clicked.

modifier

The Modifier to be applied to this FAB.

shape

Defines the shape of this FAB's container and shadow.

appearance

Appearance of the FAB among OudsFloatingActionButtonAppearance values.

interactionSource

An optional hoisted MutableInteractionSource for observing and emitting Interactions for this FAB. You can use this to change the FAB's appearance or preview the FAB in different states. Note that if null is provided, interactions will still happen internally.

Samples

OudsExtendedFloatingActionButton(
    label = "Label",
    onClick = { /* Do something! */ }
)

fun OudsExtendedFloatingActionButton(label: String, icon: OudsFloatingActionButtonIcon, onClick: () -> Unit, modifier: Modifier = Modifier, expanded: Boolean = true, shape: Shape = OudsFloatingActionButtonDefaults.shape, appearance: OudsFloatingActionButtonAppearance = OudsFloatingActionButtonDefaults.Appearance, interactionSource: MutableInteractionSource? = null)

Extended FABs help people take primary actions. They're wider than FABs to accommodate a text label and larger target area.

The other extended floating action button overload is for FABs without an icon.

Default content description for accessibility is extended from the extended fabs icon. For custom behavior, you can provide your own via Modifier.semantics.

Parameters

label

Label displayed inside this FAB.

icon

Icon for this FAB.

onClick

Called when this FAB is clicked.

modifier

The Modifier to be applied to this FAB.

shape

Defines the shape of this FAB's container and shadow.

expanded

Controls the expansion state of this FAB. In an expanded state, the FAB will show both the icon and label. In a collapsed state, the FAB will show only the icon.

interactionSource

An optional hoisted MutableInteractionSource for observing and emitting Interactions for this FAB. You can use this to change the FAB's appearance or preview the FAB in different states. Note that if null is provided, interactions will still happen internally.

Samples

OudsExtendedFloatingActionButton(
    label = "Label",
    icon = OudsFloatingActionButtonIcon(
        imageVector = Icons.Filled.FavoriteBorder,
        contentDescription = "Content description"
    ),
    onClick = { /* Do something! */ }
)