Skip to Content
Archi-ui 1.0.25 is released 🎉

Button

Buttons allow users to take actions, and make choices, with a single tap. Button communicate actions that users can take.

Basic button

Usage

import { Button } from 'archi-ui'
<Button>Button</Button>

Variant

The Button comes with three variants: ghost(default), filled, outlined, link.

Disabled Button

Sizes

Use size prop to change the size of the button.

Rounded Button

For different border rdius for buttons use rounded prop.

Full Width

Use fullwidth prop to make the button full-width.

Color

Use color prop to apply different colors for component.

To use the Button component as hyperlink, just pass href prop or change the root element to <a> tag using component prop.

If href prop is passed, an <a> element will be used as the root node.

Buttons with icons and label

Sometimes you might want to have icons for certain buttons to enhance the UX of the applications as we recognize logos more easily then plan text. For example, if you have a delete button you can label it with a trash/dustbin icon.

Loading Button

Use the loading prop to set buttons in a loading state and disable interactions.

loading

Loading Position

loading indicator can be placed before / after the children if the button is in loading state.

Toggle the loading switch to see the transition between the different states.

loading

Custom loading indicator

To customize the default loading indicator, use the loadingIndicator prop.

By default, it renders a <CircularProgress /> component as loading indicator.

loading

Button API

API reference docs for the React Button component.

Props

NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Override or extend the styles applied to the component
variant'filled' | 'outlined' | 'ghost' | 'link''ghost'The variant to use.
size'sm' | 'md' | 'lg''md'The size of the component.
rounded'none' | 'full' | 'sm' | 'md' | 'lg''sm'The border-radius of the component.
color'primary' | 'secondary' | 'info' | 'warning' | 'success' | 'error''primary'The color of the component.
disabledboolfalseIf true, the component is disabled.
componentelementType-The component used for the root node. Either a string to use a HTML element or a component.
hrefstring-The URL to link to when the button is clicked. If defined, an <a> element will be used as the root node.
fullwidthboolfalseIf true, the button will take up the full width of its container.
endIconnode-Element placed after the children.
startIconnode-Element placed before the children.
loadingboolnullIf true, the loading indicator is visible and the button is disabled.
loadingIndicatornode<CircularProgress size="sm" />Element is placed before the children if the button is in loading state. By default, it renders a ‘CircularProgress’ as loading indicator.
loadingPosition'center' | 'end' | 'start''center'The loading indicator can be positioned on the start, end, or the center of the button.
Last updated on