Bottom Sheets

Bottom sheet is a slides up from bottom of screen to reveal additional content or actions.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

Bottom Sheet Preview

Usage

import id.co.biofarma.binduiandroid.components.bottomsheets.BottomSheet
BottomSheet(
    title = "Title",
    titleAlignment = TitleBottomSheetAlignment.LEFT,
    isVisible = isLeftAligned,
    secondaryButtonLabel = "Cancel",
    primaryButtonLabel = "Save",
    onDismiss = { isLeftAligned = false }
){
repeat(itemCount) {
    Box(
        modifier = Modifier
            .padding(8.dp)
            .height(50.dp)
            .fillMaxWidth(),
        contentAlignment = Alignment.Center
    ) {
        Canvas(
            modifier = Modifier
                .fillMaxSize()
                .padding(horizontal = 16.dp)
        ) {
            drawRoundRect(
                color = Color(0xff008AA0),
                size = size,
                style = Stroke(
                    width = 2.dp.toPx(),
                    pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 10f), 0f)
                ),
            )
            drawRect(
                color = Color(0xffE6F5F7).copy(alpha = 0.7f),
                size = size
            )
        }
        Text(
            text = "PLACEHOLDER",
            style = Typography.Button.Medium,
            color = Color(0xff34ADC0),
            modifier = Modifier.padding(12.dp)
        )
    }
}
}

Examples

No Title (optional)

Use no title if the bottom sheet does not use a title.

Bottom Sheet Example No Title


No Action Button (optional)

Use no action button if the bottom sheet does not use a action button.

Bottom Sheet Example No Title



No Title and No Action Button (optional)

Use no title and no action button if the bottom sheet does not use a title and action button.

Bottom Sheet Example No Title


Props

PropsRequiredDefaultTypedescription
titlefalse-stringFor set the title of bottom sheet component.
titleAlignmentfalse-TitleBottomSheetAlignmentFor set the title alignment of bottom sheet component.
isVisiblefalsefalsebooleanFor toggle controls the visibility of the bottom sheet.
hideCloseIconfalsefalsebooleanFor toggle determines whether the close icon should be hidden.
onDismissfalse-() -> UnitCallback function triggered when the bottom sheet is dismissed.
isSystemInDarkThemefalsefalsebooleanFor toggle determines the theme mode for the bottom sheet.
sheetStatefalse-SheetStateCustom sheet state for advanced configuration
modifierfalse-modifierModifier for additional styling and layout modifications.
scrimColorfalse-colorFor color of the scrim (overlay) behind the bottom sheet.
secondaryButtonLabelfalse-stringTo set the label for the secondary (left) button.
onSecondaryButtonClickfalse-(() -> Unit)?Callback for the secondary button click event.
primaryButtonLabelfalse-stringTo set the label for the primary (right) button.
onPrimaryButtonClickfalse-(() -> Unit)?Callback for the primary button click event.
contentfalse-@Composable ColumnScope.() -> UnitFor content of the bottom sheet.
BIND © Biofarma Innovate Next-level Design .