Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Latest commit

 

History

History
111 lines (88 loc) · 2.47 KB

File metadata and controls

111 lines (88 loc) · 2.47 KB

Buttons/Button

Standard button.

Button example

<div>
    <Button type="primary" size="large">Button</Button>
    <Button type="secondary" size="large">Button</Button>
    <Button type="cta" size="large">Button</Button>
</div>

Button example

import { faBug } from '@fortawesome/free-solid-svg-icons';

<div>
    <Button type="primary" size="large">
        <Icon name={faBug} />
        Button
    </Button>
    <Button type="secondary" size="large">
        <Icon name={faBug} />
        Button
    </Button>
    <Button type="cta" size="large">
        <Icon name={faBug} />
        Button
    </Button>
</div>

Button example

import { faPlus } from '@fortawesome/free-solid-svg-icons';

<div>
    <Button shape="square" type="secondary" size="small">
        <Icon name={faPlus} />
    </Button>&nbsp;
    <Button shape="square" type="secondary" size="medium">
        <Icon name={faPlus} />
    </Button>&nbsp;
    <Button shape="square" type="secondary" size="large">
        <Icon name={faPlus} />
    </Button>
</div>

Button example

import { faPlus } from '@fortawesome/free-solid-svg-icons';

<div>
    <Button shape="round" type="secondary" size="small">
        <Icon name={faPlus} />
    </Button>&nbsp;
    <Button shape="round" type="secondary" size="medium">
        <Icon name={faPlus} />
    </Button>&nbsp;
    <Button shape="round" type="secondary" size="large">
        <Icon name={faPlus} />
    </Button>
</div>

Props

size={string}
One of "large", "medium", or "small".

type={string}
Controls the color of the button. One of "primary", "secondary", or "cta".

shape={string}
Controls the shape of the button. One of "default", "square", or "round".

disabled={bool}
Whether or not the button is disabled or not.

CSS

Adds dp-button to the root element.

Adds dp-button--${type} where ${type} is the value of the type prop.

Examples

import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from 'Components/Buttons';
import Icon from 'Components/Icon';

const App = () => (
    <div>
        <Button size="large">Button</Button>
        <Button size="medium">
            <Icon name="bug" />
            Button with icon
        </Button>
    </div>
);

ReactDOM.render(<App />, document.getElementById('mount'));