Components
Button
A flexible and customizable button component for various actions.
Installation
npm install @mijn-ui/react-buttonUsage
import { Button } from "@mijn-ui/react-button"<Button variant="outlined">Button</Button>Example
Variants
filled
outlined
subtle
ghost
light
Colors
default
brand
secondary
success
warning
danger
inverse
Sizes
sm
md
lg
IconOnly
sm
md
lg
Loading
API Reference
Standard element attributes are forwarded to the underlying component in addition to the props below.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "filled" | "outlined" | "subtle" | "ghost" | "light" | "filled" | Visual style of the button. |
color | "default" | "brand" | "secondary" | "success" | "warning" | "danger" | "inverse" | "default" | Color scheme, used with the style variants (filled, outlined, ghost, subtle, light). |
size | "sm" | "md" | "lg" | "md" | Size of the button. |
iconOnly | boolean | false | Render a square, icon-only button. |
loading | boolean | false | Show a loading spinner and disable the button. |
asChild | boolean | false | Merge props onto the child element instead of rendering a button. |
unstyled | boolean | false | Opt out of the default styles to fully customize the component. |
classNames | object | — | Override classes per slot (see Style Slots below). |
className | string | — | Additional classes for the root element. |
Button Style Slots
| Slot Name | Targeted Component | Purpose |
|---|---|---|
base | Button | Styles the button component. |
icon | Button | Styles the icon inside the button. |