Button

Clicable component

Import

import { Button } from '@windmill/react-ui'

Size

There are four sizes, applied by the prop size: larger, large, regular (default) and small.

live editor

Layout

There are three styles, applied by the prop layout: primary (default), outline and link.

live editor

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.

live editor

Disabled

The disabled prop applies disabled styles to any button.

live editor

Block

The block property is a shortcut for className="w-full" and makes the Button span the whole width of its parent.

live editor

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}

live editor

Props overview

PropDescriptionTypeDefault
sizedefine the size of componentlarger, large, regular, smallregular
layoutdefine the layout of componentprimary, outline, linkprimary
iconadd an icon to the buttonReactNode
iconLeftadd an icon to the left of the buttonReactNode
iconRightadd an icon to the right of the buttonReactNode
disableddisable state of buttonbooleanfalse
blockexpand full widthbooleanfalse
tagdefine the element tagstring, ReactNodebutton

Customizing

See Customization to learn how to change defaultTheme styles.