2020-02-13 19:43:20 -03:00
|
|
|
---
|
|
|
|
|
name: Button
|
|
|
|
|
menu: Components
|
|
|
|
|
route: components/button
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
import { Playground, Props } from 'docz';
|
|
|
|
|
import Button from './';
|
|
|
|
|
|
|
|
|
|
# Button
|
|
|
|
|
|
|
|
|
|
Buttons are used to execute actions when users interacts with them.
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
|
|
<Props of={Button} />
|
|
|
|
|
|
2020-03-02 13:37:00 -05:00
|
|
|
## Contained Buttons
|
2020-02-13 19:43:20 -03:00
|
|
|
|
|
|
|
|
<Playground>
|
|
|
|
|
<>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="contained" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Default
|
|
|
|
|
</Button>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="contained" color="primary" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Primary
|
|
|
|
|
</Button>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="contained" color="secondary" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Secondary
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
</Playground>
|
|
|
|
|
|
2020-03-02 13:37:00 -05:00
|
|
|
## Outlined Buttons
|
2020-02-13 19:43:20 -03:00
|
|
|
|
|
|
|
|
<Playground>
|
|
|
|
|
<>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="outlined" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Default
|
|
|
|
|
</Button>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="outlined" color="primary" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Primary
|
|
|
|
|
</Button>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="outlined" color="secondary" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Secondary
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
</Playground>
|
|
|
|
|
|
|
|
|
|
## Text Buttons
|
|
|
|
|
|
|
|
|
|
<Playground>
|
|
|
|
|
<>
|
2020-02-25 19:00:33 -03:00
|
|
|
<Button variant="text" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Default
|
|
|
|
|
</Button>
|
2020-02-25 19:00:33 -03:00
|
|
|
<Button variant="text" color="primary" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Primary
|
|
|
|
|
</Button>
|
2020-02-25 19:00:33 -03:00
|
|
|
<Button variant="text" color="secondary" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Secondary
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
</Playground>
|
|
|
|
|
|
|
|
|
|
## Sizes
|
|
|
|
|
|
|
|
|
|
<Playground>
|
|
|
|
|
<>
|
|
|
|
|
<div>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="text" size="small" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Small
|
|
|
|
|
</Button>
|
2020-02-25 19:00:33 -03:00
|
|
|
<Button variant="contained" size="medium" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Medium
|
|
|
|
|
</Button>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button variant="outlined" size="large" className="m-1">
|
2020-02-13 19:43:20 -03:00
|
|
|
Large
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button
|
2020-03-02 13:37:00 -05:00
|
|
|
variant="text"
|
2020-02-13 19:43:20 -03:00
|
|
|
size="small"
|
|
|
|
|
color="primary"
|
2020-02-25 19:00:33 -03:00
|
|
|
className="m-1"
|
2020-02-13 19:43:20 -03:00
|
|
|
>
|
|
|
|
|
Small
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
size="medium"
|
|
|
|
|
color="primary"
|
2020-02-25 19:00:33 -03:00
|
|
|
className="m-1"
|
2020-02-13 19:43:20 -03:00
|
|
|
>
|
|
|
|
|
Medium
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
2020-03-02 13:37:00 -05:00
|
|
|
variant="outlined"
|
2020-02-13 19:43:20 -03:00
|
|
|
size="large"
|
|
|
|
|
color="primary"
|
2020-02-25 19:00:33 -03:00
|
|
|
className="m-1"
|
2020-02-13 19:43:20 -03:00
|
|
|
>
|
2020-03-02 13:37:00 -05:00
|
|
|
large
|
2020-02-28 15:31:42 -03:00
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2020-03-02 13:37:00 -05:00
|
|
|
<Button
|
|
|
|
|
variant="text"
|
|
|
|
|
size="small"
|
|
|
|
|
color="secondary"
|
|
|
|
|
className="m-1"
|
|
|
|
|
>
|
|
|
|
|
Small
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
size="medium"
|
|
|
|
|
color="secondary"
|
|
|
|
|
className="m-1"
|
|
|
|
|
>
|
|
|
|
|
Medium
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outlined"
|
|
|
|
|
size="large"
|
|
|
|
|
color="secondary"
|
|
|
|
|
className="m-1"
|
|
|
|
|
>
|
|
|
|
|
Large
|
|
|
|
|
</Button>
|
2020-02-13 19:43:20 -03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
|
|
</Playground>
|
|
|
|
|
|
|
|
|
|
## Buttons with icons
|
|
|
|
|
|
|
|
|
|
<Playground>
|
|
|
|
|
{() => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex">
|
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
color="primary"
|
2020-02-25 19:00:33 -03:00
|
|
|
className="m-1"
|
2020-02-13 19:43:20 -03:00
|
|
|
startIcon={
|
|
|
|
|
<svg
|
2020-03-02 13:37:00 -05:00
|
|
|
class="fill-current w-4 h-4"
|
2020-02-13 19:43:20 -03:00
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
viewBox="0 0 20 20"
|
|
|
|
|
>
|
|
|
|
|
<path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" />
|
|
|
|
|
</svg>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Download
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
color="primary"
|
2020-02-25 19:00:33 -03:00
|
|
|
className="m-1"
|
2020-02-13 19:43:20 -03:00
|
|
|
endIcon={
|
|
|
|
|
<svg
|
2020-03-02 13:37:00 -05:00
|
|
|
class="fill-current w-4 h-4"
|
2020-02-13 19:43:20 -03:00
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
viewBox="0 0 20 20"
|
|
|
|
|
>
|
|
|
|
|
<path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" />
|
|
|
|
|
</svg>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Download
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
</Playground>
|