Button

Buttons enable users to take actions or navigate to different pages. They come in various styles to suit different needs and are particularly effective for drawing attention to the actions users need to take in order to progress in a workflow.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab
Button Preview

Usage

import id.co.biofarma.binduiandroid.components.button.Button
Button(
    text = "Button",
    type = "solid",
    variant = "primary",
    size = "md",
    radius = "xs",
    disabled = false,
    onClick = { println("Button clicked!") },
    loading = false,
    icon = Icons.Filled.Add
)

Examples

Variants

Use the variants primary, secondary, or danger to change color style of the Button.

Button Example Variant

Type

Use the type solid, outline, subtle, ghost, or link to change the visual style of the Button.

Button Example Type

Size

Use the size xs, sm, md, or lg to change the size of the Button.

Button Example Size

Loading

Enable the isLoading to set button become loading state. And can set loadingPosition to left or right loading.

Button Example Loading

Props

PropsRequiredDefaultTypedescription
idfalse-stringA unique identifier for the button.
texttrue-stringThe text in the button.
typefalsesolidsolid, subtle, outline, ghost, linkThe visual style type of the button.
variantfalseprimaryprimary, secondary, dangerThe visual style variant of the button.
sizetruemdxs, sm, md, lgThe size of the button
radiustruexsnone, xs, sm, md, lg, fullCorner radius of the button
stylefalse-ModifierCustom styles for the button component.
iconfalse-ImageVector?Provide for Icon Button (Icon Only)
startIconfalse-ImageVector?If added, the button will show an icon before the button’s label
endIconfalse-ImageVector?If added, the button will show an icon after the button’s label.
disabledfalsefalsetrue, falseIf true, button will be set to be disabled state
onClickfalse-() -> UnitCallback function to run when the button is clicked.
loadingfalsefalsetrue, falseIf true, the button will be set to be loading state
loadingPositionfalsestartstart, endIt determines the position of the spinner when isLoading is true (start or end)
labelLoadingfalse"Loading"stringThe button label when it is loading.
BIND © Biofarma Innovate Next-level Design .