OudsExtendedFloatingActionButton

fun OudsExtendedFloatingActionButton(label: String, onClick: () -> Unit, modifier: Modifier = Modifier, 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.

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

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.FavoriteBorder
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.PreviewLightDark
import com.orange.ouds.core.component.OudsExtendedFloatingActionButton
import com.orange.ouds.core.component.OudsFloatingActionButton
import com.orange.ouds.core.component.OudsFloatingActionButtonIcon
import com.orange.ouds.core.component.OudsLargeFloatingActionButton
import com.orange.ouds.core.component.OudsSmallFloatingActionButton
import com.orange.ouds.core.utilities.OudsPreview

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

fun OudsExtendedFloatingActionButton(label: String, icon: OudsFloatingActionButtonIcon, onClick: () -> Unit, modifier: Modifier = Modifier, expanded: Boolean = true, 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.

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

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.FavoriteBorder
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.PreviewLightDark
import com.orange.ouds.core.component.OudsExtendedFloatingActionButton
import com.orange.ouds.core.component.OudsFloatingActionButton
import com.orange.ouds.core.component.OudsFloatingActionButtonIcon
import com.orange.ouds.core.component.OudsLargeFloatingActionButton
import com.orange.ouds.core.component.OudsSmallFloatingActionButton
import com.orange.ouds.core.utilities.OudsPreview

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