test-react-ui-button
Version:
The test-react-ui-button component provides users a way to trigger actions in the UI.
18 lines • 1.74 kB
Markdown
## Button Props Table
| Prop Name | Type | Is Required | Default Value | Description |
|-|-|-|-|-|
| href| `string`| optional| | Sets the href. When set will render the component as an anchor tag.|
| icon| `element`| optional| | An optional icon. Nested inline with the text when provided.|
| isBlock| `bool`| optional| `false`| Whether or not the button should display as a block.|
| isCompact| `bool`| optional| `false`| Whether or not the button has reduced padding|
| isDisabled| `bool`| optional| `false`| Whether or not the button should be disabled.|
| isIconOnly| `bool`| optional| `false`| Whether or not the button should only display as an icon.|
| isReversed| `bool`| optional| `false`| Reverses the position of the icon and text.|
| onBlur| `func`| optional| | Callback function triggered when button loses focus.|
| onClick| `func`| optional| | Callback function triggered when clicked.|
| onFocus| `func`| optional| | Callback function triggered when button gains focus.|
| onKeyDown| `func`| optional| | Callback function triggered when key is pressed.|
| onKeyUp| `func`| optional| | Callback function triggered when key is released.|
| text| `string`| `required`| | Sets the button text. If the button `isIconOnly` or of variant `Button.Opts.Variants.UTILITY`, this text is set as the aria-label for accessibility.|
| type| `string`| optional| `'button'`| Sets the button type. One of `Button.Opts.Types.BUTTON`, `Button.Opts.Types.SUBMIT`, or `Button.Opts.Types.RESET`.|
| variant| `string`| optional| `'neutral'`| Sets the button variant. One of `Button.Opts.Variants.NEUTRAL`, `Button.Opts.Variants.EMPHASIS`, `Button.Opts.Variants['DE-EMPHASIS']`, `Button.Opts.Variants.ACTION` or `Button.Opts.Variants.UTILITY`.|