2022-10-07 17:50:28 +02:00
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import { ButtonSecondary } from './button-secondary';
# ButtonSecondary
The `ButtonSecondary` is an extension of `ButtonBase` to support secondary styles.
<Canvas>
2023-01-20 20:27:46 +01:00
<Story id="components-componentlibrary-buttonsecondary--default-story" />
2022-10-07 17:50:28 +02:00
</Canvas>
## Props
2023-01-20 20:27:46 +01:00
The `ButtonSecondary` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) and [ButtonBase](/docs/components-componentlibrary-buttonbase--default-story#props) component props
2022-10-07 17:50:28 +02:00
<ArgsTable of={ButtonSecondary} />
### Size
Use the `size` prop and the `SIZES` object from `./ui/helpers/constants/design-system.js` to change the size of `ButtonSecondary`. Defaults to `SIZES.MD`
Optional: `BUTTON_SIZES` from `./button-base` object can be used instead of `SIZES`.
Possible sizes include:
- `SIZES.SM` 32px
- `SIZES.MD` 40px
- `SIZES.LG` 48px
<Canvas>
2023-01-20 20:27:46 +01:00
<Story id="components-componentlibrary-buttonsecondary--size" />
2022-10-07 17:50:28 +02:00
</Canvas>
```jsx
2023-02-02 21:15:26 +01:00
import { Size } from '../../../helpers/constants/design-system';
2023-01-25 20:54:08 +01:00
import { ButtonSecondary } from '../../component-library';
2022-10-07 17:50:28 +02:00
2023-02-02 21:15:26 +01:00
<ButtonSecondary size={Size.SM} />
<ButtonSecondary size={Size.MD} />
<ButtonSecondary size={Size.LG} />
2022-10-07 17:50:28 +02:00
```
2022-11-09 22:55:13 +01:00
### Danger
2022-10-07 17:50:28 +02:00
2022-11-15 21:48:24 +01:00
Use the `danger` boolean prop to change the `ButtonSecondary` to danger color.
2022-10-07 17:50:28 +02:00
<Canvas>
2023-01-20 20:27:46 +01:00
<Story id="components-componentlibrary-buttonsecondary--danger" />
2022-10-07 17:50:28 +02:00
</Canvas>
```jsx
2023-01-25 20:54:08 +01:00
import { ButtonSecondary } from '../../component-library';
2022-10-07 17:50:28 +02:00
<ButtonSecondary>Normal</ButtonSecondary>
<ButtonSecondary danger>Danger</ButtonSecondary>
```