Button
Clickable action — 8 variants × 8 sizes, focus ring, press feedback.
ui actions
Preview
Installation
npx slintcn@latest add buttonUsage
import { Button, ButtonVariant, ButtonSize } from "slintcn/components/button.slint";
Button {
variant: ButtonVariant.default;
size: ButtonSize.lg;
text: "Ship it";
clicked => { /* … */ }
}
Properties
variant
in
ButtonVariant
Visual style — default, secondary, outline, ghost, link, destructive, success, glow.
size
in
ButtonSize
Height + horizontal padding preset — xs, sm, default, lg, xl, xxl, xxxl, icon.
text
in
string
Label rendered inside the button.
disabled
in
bool
When true, the button dims and stops firing `clicked`.
clicked
callback
()
Fired on press release while enabled.
API
ButtonVariantdefaultoutlinesecondaryghostlinkdestructiveglowglassButtonSizexssmdefaultlgiconicon-xsicon-smicon-lgAccessibility
focusableyeskeyboardEnterSpaceDependencies
theme only
Installed automatically as transitive dependencies of slintcn add button.