import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import { ButtonBase } from './button-base';
### This is a base component. It should not be used in your feature code directly but as a "base" for other UI components
# ButtonBase
The `ButtonBase` is the base component for buttons.
## Props
The `ButtonBase` accepts all props below as well as all [Box](/docs/ui-components-ui-box-box-stories-js--default-story#props) component props
### Size
Use the `size` prop and the `SIZES` object from `./ui/helpers/constants/design-system.js`
to change the size of `ButtonBase`. Defaults to `SIZES.MD`
Optional: `BUTTON_SIZES` from `./button-base` object can be used instead of `SIZES`.
Possible sizes include:
- `SIZES.AUTO` inherits the font-size of the parent element.
- `SIZES.SM` 32px
- `SIZES.MD` 40px
- `SIZES.LG` 48px
```jsx
import { SIZES } from '../../../helpers/constants/design-system';
import { ButtonBase } from '../ui/component-library';
```
### Block
Use boolean `block` prop to quickly enable a full width block button
```jsx
import { DISPLAY } from '../../../helpers/constants/design-system';
import { ButtonBase } from '../ui/component-library';
Default Button
Block Button
```
### As
Use the `as` box prop to change the element of `ButtonBase`. Defaults to `button`.
Button `as` options:
- `button`
- `a`
```jsx
import { ButtonBase } from '../ui/component-library';
Button Element
Anchor Element
```
### Disabled
Use the boolean `disabled` prop to disable button
```jsx
import { ButtonBase } from '../ui/component-library';
Disabled Button;
```
### Loading
Use the boolean `loading` prop to set loading spinner
```jsx
import { ButtonBase } from '../ui/component-library';
Loading Button;
```
### Icon
Use the `icon` prop and the `ICON_NAMES` object from `./ui/components/component-library/icon` to select icon.
```jsx
import { ButtonBase } from '../ui/component-library';
import { ICON_NAMES } from '../icon';
Button;
```