Components

A flexible and customizable button component for various actions.

Installation

npm install @mijn-ui/react-button

Usage

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.

PropTypeDefaultDescription
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.
iconOnlybooleanfalseRender a square, icon-only button.
loadingbooleanfalseShow a loading spinner and disable the button.
asChildbooleanfalseMerge props onto the child element instead of rendering a button.
unstyledbooleanfalseOpt out of the default styles to fully customize the component.
classNamesobjectOverride classes per slot (see Style Slots below).
classNamestringAdditional classes for the root element.

Button Style Slots

Slot NameTargeted ComponentPurpose
baseButtonStyles the button component.
iconButtonStyles the icon inside the button.