Button for actions. One primary per area; danger for destructive actions; icon-only needs label. Works as a form submit/reset button through ElementInternals.
Examples
Variants and sizes
variant sets the visual weight: one primary per area, ghost for quiet actions, danger for destructive ones. size="sm" (28px) fits tables and toolbars.
Start scanExport CSVSnapshotFactory reset …UpdateSearch again
Put a kern-icon into the start slot before the text. icon-only shows just the icon and needs label as its accessible name. busy shows a spinner, sets aria-busy and ignores clicks; disabled turns the button off.
type="submit" and type="reset" work inside a <form> like native buttons. With href the button renders a link, e.g. to download a backup; use it when an action navigates.
The link inside kern-button lives in the shadow DOM, so routerLink and friends cannot catch its click. Instead, a plain left click on a button with href emits the cancelable kernNavigate with { href, event }. Call preventDefault() to stop the page load and route yourself. Ctrl/Cmd click, middle click, target="_blank" and download emit nothing and stay with the browser, so "open in new tab" keeps working.
React 19 binds onkernNavigate directly (older versions need addEventListener through a ref); Vue binds @kernNavigate in single-file components.
Square button that shows only the start slot or default slot icon. Requires label.
label
string | undefined
Accessible name (required for icon-only buttons).
sizereflectsdefault 'md'
"md" | "sm"
sm = 28px for tables and toolbars.
target
string | undefined
typedefault 'button'
"button" | "reset" | "submit"
variantreflectsdefault 'default'
"danger" | "default" | "ghost" | "primary"
Visual weight.
Events
kernNavigate
CustomEvent<KernNavigateDetail>
With href: plain left click (no modifier keys, target, download) before the browser navigates. preventDefault() stops the navigation, so a SPA router can take over.