Balance Logo
Balance
Reckon Design System
Open playroom

Button

Buttons are used to trigger actions based on a user's interaction.
Install
pnpm add @balance-web/button
Import usage
import {
Button,
IconButton
} from '@balance-web/button';
  • Code
  • API

Button

Buttons allow users to perform an action or to navigate to another page / view. Buttons let users understand what will happen next.

colorScheme

Color scheme are used to indicate the importance of an action.

Default value is primary

Edit in Playroom

variant

Variant are used to change the visual style of a button.

Default value is filled

size

The Button is available in three sizes.

Default value is medium.

disabled

When disabled the button is not interactive to the user.

loading

Use the loading property to indicate that an action is in progress. Note that buttons are not interactive whilst loading.

block

Use the block property to make the button fill its container.

This is more commonly achieved by wrapping multiple buttons with the Stack component, which will automatically make the buttons fill their container.

Icons

Icons can be used in buttons when additional clarity is required and the icon is highly relevant to the action. Avoid using two icons in a button.

Use iconBefore to help the user learn about the action of the button quickly or to indicate the user will go back to previous step in the flow.

Use iconAfter to help the user learn if there is a change in the flow (open new tab or window for example) or to indicate the user will go to next step in the flow.

IconButton

The icon button shares its rules regarding colorScheme, variant and size with the standard button. For brevity we won't duplicate them here; refer to the above documentation where applicable.

Required props

The IconButton requires an icon property, which must be a component from the icon package.

A label is required to support accessibility. Describe the action or effect that will take place when the button is clicked.

colorScheme

Color scheme are used to indicate the importance of an action.

Default value is primary.

variant

The IconButton is available in three variants, filled is the default.

size

The IconButton is available in two sizes, medium is the default.

disabled

When disabled the button will not be interactive to the user.

To have a link that looks like a button, use the as prop to render an <a> instead of a <button>.

If you're doing client side routing using Next, use as={NextLink} instead of as="a".

import { Button } from '@balance-web/button-deprecated';
import { NextLink } from '@balance-web/next-link';
<Button as={NextLink} href="/" label="Button component a link" />;

Migration guide

Below is a mapping from DeprecatedButton to the new Button component. This mapping is about the tone and weight props on DeprecatedButton to colorScheme and variant props on Button. All other props should behave the same.

If this mapping doesn't cover a particular scenario, talk to a design.

All color schemes and variants

Copyright © 2024 Reckon. Designed and developed in partnership with Thinkmill.
Bitbucket logoJira software logoConfluence logo