|
| 1 | +import { PropsTable } from '@/components/props-table' |
| 2 | + |
1 | 3 | ###### API |
2 | 4 |
|
3 | 5 | `Button` props extends the button HTML attributes. |
4 | 6 |
|
5 | | -<div style={{ width: '100%', overflow: 'auto'}}> |
6 | | -| Property | Description | Type | Default | |
7 | | -| --- | --- | --- | --- | |
8 | | -| **variant** | The variant of the button | `'primary' \| 'default'` | `'default'` | |
9 | | -| **colors** | The color variables of the button, i.e. `var(--primary)` | ```{<br> primary?: string<br> error?: string<br> text?: string<br> border?: string<br> inputBackground?: string<br> primaryFocus?: string<br>}``` | `undefined` | |
10 | | -| **danger** | Signals that it should be used with caution. It is often used in a delete button or to show the error status. | `boolean` | `false` | |
11 | | -| **size** | The size of the button | `'sm' \| 'md' \| 'lg'` | `'md'` | |
12 | | -| **icon** | Icon of the button passed in as a form of ReactNode | `React.ReactNode` | `undefined` | |
13 | | -| **ellipsis** | Whether the button text should be truncated with an ellipsis. The button should have a width to be able to truncate the text. | `boolean` | `false` | |
14 | | -</div> |
| 7 | +<PropsTable |
| 8 | + componentProps={[ |
| 9 | + { |
| 10 | + property: 'variant', |
| 11 | + description: 'The variant of the button', |
| 12 | + type: "`'primary' | 'default'`", |
| 13 | + default: "`'default'`", |
| 14 | + }, |
| 15 | + { |
| 16 | + property: 'colors', |
| 17 | + description: 'The color variables of the button, i.e. `var(--primary)`', |
| 18 | + type: '```{<br> primary?: string<br> error?: string<br> text?: string<br> border?: string<br> inputBackground?: string<br> primaryFocus?: string<br>}```', |
| 19 | + default: '`undefined`', |
| 20 | + }, |
| 21 | + { |
| 22 | + property: 'danger', |
| 23 | + description: |
| 24 | + 'Signals that it should be used with caution. It is often used in a delete button or to show the error status.', |
| 25 | + type: '`boolean`', |
| 26 | + default: '`false`', |
| 27 | + }, |
| 28 | + { |
| 29 | + property: 'size', |
| 30 | + description: 'The size of the button', |
| 31 | + type: "`'sm' | 'md' | 'lg'`", |
| 32 | + default: "`'md'`", |
| 33 | + }, |
| 34 | + { |
| 35 | + property: 'icon', |
| 36 | + description: 'Icon of the button passed in as a form of ReactNode', |
| 37 | + type: '`React.ReactNode`', |
| 38 | + default: '`undefined`', |
| 39 | + }, |
| 40 | + { |
| 41 | + property: 'ellipsis', |
| 42 | + description: |
| 43 | + 'Whether the button text should be truncated with an ellipsis. The button should have a width to be able to truncate the text.', |
| 44 | + type: '`boolean`', |
| 45 | + default: '`false`', |
| 46 | + }, |
| 47 | + ]} |
| 48 | +/> |
0 commit comments