Files
ohif-viewer/platform/ui/src/components/Button/Button.mdx
T

180 lines
3.2 KiB
Plaintext
Raw Normal View History

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} />
## Contained Buttons
2020-02-13 19:43:20 -03:00
<Playground>
<>
<Button variant="contained" className="m-1">
2020-02-13 19:43:20 -03:00
Default
</Button>
<Button variant="contained" color="primary" className="m-1">
2020-02-13 19:43:20 -03:00
Primary
</Button>
<Button variant="contained" color="secondary" className="m-1">
2020-02-13 19:43:20 -03:00
Secondary
</Button>
</>
</Playground>
## Outlined Buttons
2020-02-13 19:43:20 -03:00
<Playground>
<>
<Button variant="outlined" className="m-1">
2020-02-13 19:43:20 -03:00
Default
</Button>
<Button variant="outlined" color="primary" className="m-1">
2020-02-13 19:43:20 -03:00
Primary
</Button>
<Button variant="outlined" color="secondary" className="m-1">
2020-02-13 19:43:20 -03:00
Secondary
</Button>
</>
</Playground>
## Text Buttons
<Playground>
<>
<Button variant="text" className="m-1">
2020-02-13 19:43:20 -03:00
Default
</Button>
<Button variant="text" color="primary" className="m-1">
2020-02-13 19:43:20 -03:00
Primary
</Button>
<Button variant="text" color="secondary" className="m-1">
2020-02-13 19:43:20 -03:00
Secondary
</Button>
</>
</Playground>
## Sizes
<Playground>
<>
<div>
<Button variant="text" size="small" className="m-1">
2020-02-13 19:43:20 -03:00
Small
</Button>
<Button variant="contained" size="medium" className="m-1">
2020-02-13 19:43:20 -03:00
Medium
</Button>
<Button variant="outlined" size="large" className="m-1">
2020-02-13 19:43:20 -03:00
Large
</Button>
</div>
<div>
<Button
variant="text"
2020-02-13 19:43:20 -03:00
size="small"
color="primary"
className="m-1"
2020-02-13 19:43:20 -03:00
>
Small
</Button>
<Button
variant="contained"
size="medium"
color="primary"
className="m-1"
2020-02-13 19:43:20 -03:00
>
Medium
</Button>
<Button
variant="outlined"
2020-02-13 19:43:20 -03:00
size="large"
color="primary"
className="m-1"
2020-02-13 19:43:20 -03:00
>
large
2020-02-28 15:31:42 -03:00
</Button>
</div>
<div>
<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"
className="m-1"
2020-02-13 19:43:20 -03:00
startIcon={
<svg
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"
className="m-1"
2020-02-13 19:43:20 -03:00
endIcon={
<svg
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>