Install the component from your command line.
yarn add @f8n/components/button
Import all parts and piece them together.
<Button variant="primary" onClick={() => null}>
Click me
</Button>
Prop | Type | Description | Default |
---|---|---|---|
icon | boolean , or standalone | — | false |
size | 0 , 1 or 2 | — | 1 |
variant | blur ,danger ,ghost ,outline ,primary , or raised | — | outline |
There are a few standard variants that can be used depending on context. Some work better on white backgrounds and other work better on images.
<Button variant="ghost" onClick={() => null}>
Click me
</Button>
<Button variant="primary" onClick={() => null}>
Click me
</Button>
<Button variant="outline" onClick={() => null}>
Click me
</Button>
<Button variant="raised" onClick={() => null}>
Click me
</Button>
We also have a special variant called blur
meant to be used on image backgrounds.
<Button variant="blur" onClick={() => null}>
Click me
</Button>
These sizes are standardized across form components.
<Button size={2}>
Click me
</Button>
<Button size={1}>
Click me
</Button>
<Button size={0}>
Click me
</Button>
The icon can either be used on its own, or alongside some text. Note: Don't forget to wrap the text in a span
to properly space it from the icon.
<Button icon={standalone}>
<ArrowLeftIcon />
</Button>
<Button icon>
<ArrowLeftIcon />
<span>Click me</span>
</Button>