Button
Starts an action. Every button is a pill; exactly one per view is ink.
<Button variant="primary">Create key</Button>import { Button } from "@logicplanes/kaeso-ui";Props
childrenReactNodeThe button's label: a verb first, in sentence case. A label wider than its container is cut with an ellipsis and shown whole in a tooltip.
countnumberA count after the label.
disabledReasonstringWhy the button is disabled, shown as a tooltip and read out as the button's description. The button stays focusable so people can reach it.
downloadstringWith
href, saves the file the link points to under this name instead of opening it, such as a generated image (blob:anddata:links included).fullWidthbooleanFills the width of its container.
hrefstringRenders a link that looks like the button.
iconIconSvgElementMakes it an icon-only circle with this icon. Give it an
aria-label: the name screen readers read and the tooltip shows.leadingIconIconSvgElementAn icon before the text.
loadingbooleanWork is underway: the button is busy and ignores clicks at once; the spinner shows only once the work has taken 300ms, then for at least 400ms (
useDelayedLoading). It replaces the leading icon, or covers the label; the width never changes.onPressedChange((pressed: boolean) => void)Called with the new state when a toggle button is pressed.
pressedbooleanMakes it a toggle button that is on or off (
aria-pressed); withvariant="selector", a check shows while it is on.relstringThe link's relationship, as on an
aelement.reserveLabelsReactNode[]Every label this button can show ("Copy key", "Copied"). The button keeps the width of the widest, so a state change never resizes it.
shortcutstring[] | string[][]A shortcut hint: after the label (lg and xl, and in menus), or in the tooltip of an icon-only button.
size"md" | "xs" | "sm" | "lg" | "xl"The height, from
xs(24px) toxl(48px).staticbooleanKeeps the button still when pressed, for a control whose 0.96 press would distract; it still darkens.
targetstringWhere the link opens, as on an
aelement.tooltipbooleanTurns off an icon-only button's tooltip, for when a visible label sits next to it or the button has a tooltip of its own.
tooltipSide"top" | "bottom" | "left" | "right"Where an icon-only button's tooltip appears.
trailingIconIconSvgElementAn icon after the text.
variant"danger" | "link" | "secondary" | "primary" | "ghost" | "quiet" | "soft" | "selector" | "danger-secondary"primaryfor the one main action of a view,secondaryfor others,ghostandquietfor toolbars and rows,dangerfor destructive actions. A ghost or quiet button at the end of a settings row's control pulls its padding past the row's edge, so its label ends where an outlined button's ring does.