Import
import { Button } from '@windmill/react-ui'
Size
There are four sizes, applied by the prop size: larger, large, regular (default) and small.
Layout
There are three styles, applied by the prop layout: primary (default), outline and link.
Icon
There are three icon positions: icon applies an icon image centered in a button or, if it has children, has the same behavior as iconLeft. The other two are iconLeft and iconRight, perfect to use with text.
Disabled
The disabled prop applies disabled styles to any button.
Block
The block property is a shortcut for className="w-full" and makes the Button span the whole width of its parent.
Tag
The tag is responsible for rendering a specific HTML element as a Button, and is mostly used to create anchors styled as buttons. You can also pass another component as a tag, like a Link from react-router, eg: tag={Link}
Props overview
| Prop | Description | Type | Default |
|---|---|---|---|
size | define the size of component | larger, large, regular, small | regular |
layout | define the layout of component | primary, outline, link | primary |
icon | add an icon to the button | ReactNode | |
iconLeft | add an icon to the left of the button | ReactNode | |
iconRight | add an icon to the right of the button | ReactNode | |
disabled | disable state of button | boolean | false |
block | expand full width | boolean | false |
tag | define the element tag | string, ReactNode | button |
Customizing
See Customization to learn how to change defaultTheme styles.