OudsFloatingActionButton

fun OudsFloatingActionButton(icon: OudsFloatingActionButtonIcon, onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = OudsFloatingActionButtonDefaults.shape, appearance: OudsFloatingActionButtonAppearance = OudsFloatingActionButtonDefaults.Appearance, interactionSource: MutableInteractionSource? = null)

The FAB represents the most important action on a screen. It puts key actions within reach.

FAB typically contains an icon, for a FAB with text and an icon, see OudsExtendedFloatingActionButton.

Parameters

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.

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 
   OudsFloatingActionButton(
    icon = OudsFloatingActionButtonIcon(
        imageVector = Icons.Filled.FavoriteBorder,
        contentDescription = "Content description"
    ),
    onClick = { /* Do something! */ }
) 
   //sampleEnd
}