Swirski UI

Buttons

Button

A bold Swirski UI button used for links, actions and call-to-actions.

Component

03

Request Changes

Import

import { Button } from "@swirski/ui";

Playground

7 controls

Controls

Usage

<Button href="#preview" tone="blue">
  View pieces
</Button>

Props

11 generated
PropTypeDefaultNotes
asElementType-Custom component used for the root element, such as Next.js Link.
asChildbooleanfalsePasses button props to a single child element.
childrenReactNode-Button label or inline content.
classNamestring-Adds classes to the root button or anchor.
hrefstring-Renders the button as an anchor when provided.
icon'arrow-up-right' | 'github'-Adds a bundled icon beside the label.
iconSide'left' | 'right'"left"Controls where the optional icon is rendered.
size'sm' | 'md' | 'lg'"md"Controls the button scale.
tone'blue' | 'yellow' | 'red' | 'white' | 'black'"blue"Applies the Swirski color treatment.
variant'solid' | 'outline' | 'blue' | 'yellow' | 'red' | 'white' | 'black' | 'ghost'"solid"Controls the visual treatment independently from tone.
withShadowbooleantrueGenerated from ButtonProps.
...anchorPropsAnchorHTMLAttributes<HTMLAnchorElement>-Forwarded when the component renders an anchor.
...buttonPropsButtonHTMLAttributes<HTMLButtonElement>-Forwarded when the component renders a button.
Previous: AlertNext: Cursor