2022-10-06 06:51:02 +02:00
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>
2023-01-20 20:27:46 +01:00
<Story id="components-componentlibrary-buttonprimary--default-story" />
2022-10-06 06:51:02 +02:00
</Canvas>
## Props
<ArgsTable of={ButtonPrimary} />
### Size
2023-08-04 19:45:55 +02:00
Use the `size` prop and the `ButtonPrimarySize` enum from `./ui/components/component-library` to change the size of `ButtonPrimary`. Defaults to `ButtonPrimarySize.Md`
2022-10-06 06:51:02 +02:00
Possible sizes include:
2023-08-04 19:45:55 +02:00
- `ButtonPrimarySize.Sm` 32px
- `ButtonPrimarySize.Md` 40px
- `ButtonPrimarySize.Lg` 48px
2022-10-06 06:51:02 +02:00
<Canvas>
2023-02-14 18:33:04 +01:00
<Story id="components-componentlibrary-buttonprimary--size-story" />
2022-10-06 06:51:02 +02:00
</Canvas>
```jsx
2023-08-04 19:45:55 +02:00
import { ButtonPrimary, ButtonPrimarySize } from '../../component-library';
2022-10-06 06:51:02 +02:00
2023-08-04 19:45:55 +02:00
<ButtonPrimary size={ButtonPrimarySize.Sm} />
<ButtonPrimary size={ButtonPrimarySize.Md} />
<ButtonPrimary size={ButtonPrimarySize.Lg} />
2022-10-06 06:51:02 +02:00
```
2022-11-09 22:55:13 +01:00
### Danger
2022-10-06 06:51:02 +02:00
2022-11-09 22:55:13 +01:00
Use the `danger` boolean prop to change the `ButtonPrimary` to danger color.
2022-10-06 06:51:02 +02:00
<Canvas>
2023-01-20 20:27:46 +01:00
<Story id="components-componentlibrary-buttonprimary--danger" />
2022-10-06 06:51:02 +02:00
</Canvas>
```jsx
2023-01-25 20:54:08 +01:00
import { ButtonPrimary } from '../../component-library';
2022-10-06 06:51:02 +02:00
<ButtonPrimary>Normal</ButtonPrimary>
<ButtonPrimary danger>Danger</ButtonPrimary>
```