Atoms

Button

Brand-aware button with color and size variants.

shadcn/ui
Docs

Installation#

npx shadcn@latest add @formance/button

Install the following dependencies:

npm install class-variance-authority lucide-react radix-ui

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage#

import { Button } from '@/components/ui/button'
<Button variant="primary">Click me</Button>

Examples#

Primary#

Secondary#

Outline#

Outline Dashed#

Ghost#

Destructive#

Brand Colors#

Sizes#

With Icon#

Icon Only#

Loading#

As Child#

Wrap#

Set wrap to let a long label go on more than one line. The button grows in height, and the text aligns to the start. Use it for a full sentence, for example a suggested prompt. Set caseSensitive to keep the case of the sentence.

wrap has an effect on the sm, md and lg sizes. It has no effect on the icon sizes.

API reference#

Button#

PropTypeDefaultDescription
variant"primary" | "secondary" | "outline" | "ghost" | "link" | "destructive" | ..."primary"The visual treatment. See the examples for all the values.
size"sm" | "md" | "lg" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl""md"The height and the padding.
caseSensitivebooleanfalseKeep the case of the label. By default, the label is in uppercase.
wrapbooleanfalseLet the label go on more than one line. The height grows. The minimum height is the size's height.
notClickablebooleanfalseRemove the pointer events and the focus ring.
loadingbooleanfalseShow a spinner after the label.
asChildbooleanfalseRender the child, for example a link.