Skip to main content

Button

Custom buttons with different types and sizes are available.

Types

Use any of the available buttons by changing the type prop.

import React from 'react';
import { Button } from 'chic-ui';

<Button>Default</Button>
<Button type='secondary'>Secondary</Button>
<Button type='warning'>Warning</Button>
<Button type='success'>Success</Button>
<Button type='danger'>Danger</Button>
<Button type='light'>Light</Button>
<Button type='info'>Info</Button>

Sizes

Get small or large buttons easily by using the size prop.

import React from 'react';
import { Button } from 'chic-ui';

<Button size="small">Small</Button>
<Button>Default</Button>
<Button size="large">Large</Button>

Disabled Buttons

Use the disabled prop to disable any button.

import React from 'react';
import { Button } from 'chic-ui';

<Button disabled>Disabled</Button>
<Button disabled type='success'>Disabled</Button>

Loading

You can use the buttons to show any loading actions using the loading prop.

import React from 'react';
import { Button } from 'chic-ui';

<Button loading />
<Button loading type='secondary'/>

Icons

Icons can be used within the buttons either by using icon prop or as children.

import React from 'react';
import { Button } from 'chic-ui';

<Button icon={BiWine} type="light">
White wine!
</Button>

<Button type='danger'>
Red wine! <BiWine color="white" />
</Button>

API

import { Button } from 'chic-ui';
NameTypeDefaultDescription
type'primary' | 'secondary' | 'danger' | 'warning' | 'success' | 'info' | 'light''primary'Color of the button
size'small' | 'default' | 'large''default'Size of the button
iconElementTypeAdd icons to the buttons
childrenReactNodePass children
disabledbooleanfalseDisable a button
loadingbooleanfalseLoading button
hrefstringIf `href` is added, button becomes an anchor link
asElementTypeIf `as` is added, button becomes a custom html node specified in `as`
classNamestringProvide external classnames to the component
styleReact.CSSPropertiesOverride default styling of the component