Flutter docs
Default skin

Button

To trigger an operation.

When to use

A button means an operation or series of operations. Clicking it triggers the corresponding business logic. Use one primary button for the main action, default buttons for ordinary actions, dashed buttons for adding actions, text buttons for secondary actions, and link buttons for links.

danger, ghost, disabled, and loading refine those action states without changing the button contract.

Examples

Syntactic sugar

Use the preset primary, default, dashed, text, and link button styles through the type syntactic sugar.

Icon

Add an icon with the icon property.

Size

Small, medium, and large buttons.

Loading

Use loading or loading.icon to display and customize pending state.

Ghost Button

Ghost buttons keep a transparent background for use on colored surfaces.

Block Button

The block property makes a button fit its parent width.

Custom Wave

Customize the interaction wave with HappyProvider.

Custom semantic dom styling

Customize semantic slots with classNames and styles.

Color & Variant

Set color and variant together to derive the supported button treatments.

Icon Placement

Set iconPlacement to start or end.

Disabled

Add disabled to mark a button unavailable.

Multiple Buttons

Prefer one primary action and group overflow operations into a dropdown.

Danger Buttons

Use danger for destructive actions.

Gradient Button

Buttons with a gradient background.

Custom disabled backgroundColor

Customize disabled default and dashed button backgrounds.

Sizes

small, middle (the default), and large map to --cb-control-height-sm, --cb-control-height-md, and --cb-control-height-lg. Each is max() of a preferred step (--cb-control-height-base-*) and the active pointer floor, so a density scale can retune the ladder but never take a control under its floor. On a coarse pointer — a touch screen — --cb-control-floor becomes --cb-control-floor-coarse (2.75rem, 44px), so small and middle both reach 44px and large keeps its 48px, with no per-control CSS. A pointer that hovers keeps --cb-control-floor-fine (2rem, 32px).

API

Button and ButtonProps are exported from @ceebee/ui/client.

Button

PropertyDescriptionTypeDefaultVersion
autoInsertSpaceWe add a space between two Chinese characters by default, which removed by setting autoInsertSpace to false.booleantrue5.17.0
blockOption to fit button width to its parent widthbooleanfalse—
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-6.0.0
colorSet button colordefault | primary | danger | PresetColorsprimary when variant="solid"default, primary and danger: 5.21.0, PresetColors: 5.23.0, solid default color: 6.4.0
dangerSyntactic sugar. Set the danger status of button. will follow color if providedbooleanfalse—
disabledDisabled state of buttonbooleanfalse—
ghostMake background transparent and invert text and border colorsbooleanfalse—
hrefRedirect url of link buttonstring-—
htmlTypeSet the original html type of button, see: MDNsubmit | reset | buttonbutton—
iconSet the icon component of buttonReactNode-—
iconPlacementSet the icon position of buttonstart | endstart-
iconPositionSet the icon position of button, please use iconPlacement insteadstart | endstart5.17.0
loadingSet the loading status of buttonboolean | { delay: number, icon: ReactNode }falseicon: 5.23.0
loadingIcon(Only supports global configuration) Set the loading icon of buttonReactNode<LoadingOutlined />—
onClickSet the handler to handle click event(event: React.MouseEvent<HTMLElement, MouseEvent>) => void-—
shapeCan be used to set button shapedefault | circle | rounddefault—
sizeSet the size of buttonlarge | medium | smallmedium—
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-6.0.0
targetSame as target attribute of a, works when href is specifiedstring-—
typeSyntactic sugar. Set button type. Will follow variant & color if providedprimary | dashed | link | text | defaultdefault—
variantSet button variantoutlined | dashed | solid | filled | text | link-5.21.0