Skip to main content

Button

A clickable action styled with the design system's tokens.

Installation

npm install @sipe-team/button
import '@sipe-team/button/styles.css';

Usage

Examples

Variant

fill (default) for the primary action, outline for secondary, ghost for low-emphasis.

Size

lg (default) suits most UI; sm/md for dense layouts, xl for prominent calls to action.

With icons

leftIcon and rightIcon accept any ReactNode.

Disabled

The native disabled attribute is forwarded and styled the same for every variant — a disabled fill and a disabled outline render identically.

asChild

Render as a different element (e.g. a link) while keeping the button's styles.

Anatomy

import { Button } from '@sipe-team/button';

export default () => (
<Button variant="fill" size="lg" leftIcon={<Icon />}>
Label
</Button>
);

Renders a native <button type="button"> by default. leftIcon / rightIcon are wrapped in a span on either side of the label.

API Reference

Renders a <button type="button"> and forwards its ref.

PropTypeDefaultDescription
childrenReactNodeThe button label.
variant'fill' | 'outline' | 'ghost''fill'Visual style.
size'sm' | 'md' | 'lg' | 'xl''lg'Height, padding, radius, and font size.
leftIconReactNodeRendered before the label.
rightIconReactNodeRendered after the label.
asChildbooleanfalseMerge props onto the child instead of a button.

Also accepts every ComponentProps<'button'> (disabled, onClick, type, …), forwarded to the rendered element. type defaults to "button".