Skip to main content

Button: React

Buttons indicate possible actions or choices to a user.

Installation

Before you can start using the @chameleon/react component, you’ll need to install it, for more information check: Getting started for developers.

With that done, you’re now ready to implement the component in your application.

import { Button } from '@chameleon/react';

export default function Example() {
return <Button>Example</Button>;
}

Properties

PropertyTypeDefaultRequiredDescription
appearance'default' | 'primary' | 'secondary' | 'tertiary''default'NoControls the button's visual style.
disabledBoolean-NoIndicates whether the button is disabled or not.
iconLeftChameleonIcon | ComponentType-NoThe icon on the left side of the button. Accepts either an icon name from the icons package or a custom React component.
iconRightChameleonIcon | ComponentType-NoThe icon on the right side of the button. Accepts either an icon name from the icons package or a custom React component.
loadingBoolean-NoEnables or disables the loading state of the button. It also disables the button while in the loading state.
size'sm' | 'lg''lg'NoChanges the visual size of the Button.
width'auto' | 'full''auto'NoControls the button's width property.

as

You can use the as prop to create links that look like a Button. Please, don't wrap them with an a tag.

<Button as="a" href="#">
I'm a link
</Button>