1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 07:16:36 +01:00
metamask-extension/ui/components/component-library/button-primary/README.mdx
Garrett Bear 3915482edb
ButtonPrimary to TS (#20390)
* ButtonPrimary to TS

* button primary to ts updates

* fixes
2023-08-04 10:45:55 -07:00

53 lines
1.3 KiB
Plaintext

import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import { ButtonPrimary } from './button-primary';
# ButtonPrimary
The `ButtonPrimary` is an extension of `ButtonBase` to support primary styles.
<Canvas>
<Story id="components-componentlibrary-buttonprimary--default-story" />
</Canvas>
## Props
<ArgsTable of={ButtonPrimary} />
### Size
Use the `size` prop and the `ButtonPrimarySize` enum from `./ui/components/component-library` to change the size of `ButtonPrimary`. Defaults to `ButtonPrimarySize.Md`
Possible sizes include:
- `ButtonPrimarySize.Sm` 32px
- `ButtonPrimarySize.Md` 40px
- `ButtonPrimarySize.Lg` 48px
<Canvas>
<Story id="components-componentlibrary-buttonprimary--size-story" />
</Canvas>
```jsx
import { ButtonPrimary, ButtonPrimarySize } from '../../component-library';
<ButtonPrimary size={ButtonPrimarySize.Sm} />
<ButtonPrimary size={ButtonPrimarySize.Md} />
<ButtonPrimary size={ButtonPrimarySize.Lg} />
```
### Danger
Use the `danger` boolean prop to change the `ButtonPrimary` to danger color.
<Canvas>
<Story id="components-componentlibrary-buttonprimary--danger" />
</Canvas>
```jsx
import { ButtonPrimary } from '../../component-library';
<ButtonPrimary>Normal</ButtonPrimary>
<ButtonPrimary danger>Danger</ButtonPrimary>
```