Button
Renders a real <button type="button"> by default. Use render when the action navigates rather than does something in place, so it renders as an <a> instead.
Usage
import { Button } from "@kernelui/react";
<Button variant="primary">Save changes</Button>Props
| Prop | Type | Default |
|---|---|---|
variant | "primary" | "secondary" | "ghost" | "danger" | "secondary" |
size | "sm" | "md" | "lg" | "md" |
loading | boolean | false |
iconStart / iconEnd | ReactNode | — |
render | ReactElement | (props, state) => ReactElement | — |
Accessibility
- Space and Enter activate it, focus and disabled state are native.
- When rendered via
renderas something other than a button (an<a>, say),disabledbecomesaria-disabledplus a blocked click handler, since non-form elements have no native disabled behaviour. loadingsetsaria-busywithout changing the button's width.