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.
countnumberA count after the label.
disabledReasonstringWhy the button is disabled, shown as a tooltip. The button stays focusable so people can read it.
fullWidthbooleanFills the width of its container.
hrefstringRenders a link that looks like the button.
iconIconSvgElementThe only content of an icon button; give it an
aria-label.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.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.
shape"pill" | "circle"Icon-only buttons are circles and need an accessible name.
shortcutstring[] | string[][]A shortcut hint after the label (lg and xl, and in menus).
size"md" | "xs" | "sm" | "lg" | "xl"The height, from
xs(24px) toxl(44px).targetstringWhere the link opens, as on an
aelement.trailingIconIconSvgElementAn icon after the text.
variant"danger" | "link" | "secondary" | "primary" | "ghost" | "quiet" | "soft" | "danger-secondary"primaryfor the one main action of a view,secondaryfor others,ghostandquietfor toolbars,dangerfor destructive actions.