Button list
ButtonList component displays a list of buttons. When the number of buttons exceeds a specified threshold (controlled by the maxButtonItems prop), the component dynamically transforms into a dropdown menu.
- Import
import { ButtonList } from '@smile/haring-react'; - Extends Menu Button
- Source View Source Code
- Package @smile/haring-react
- Storybook Storybook
Storybook Docs
Props
| Name | Type | Default | Description |
|---|---|---|---|
| defaultCurrent * | string | - | The default selected value |
| items * | IItems<string> | - | Is the list of items of type IItems<string> |
| maxButtonItems | number | 0 | The value of the maximum number to display. If the number is exceeded, the button list transforms into a dropdown menu |
| buttonProps | ButtonProps | - | Props extend from the Mantine Button component, used to modify the buttons of ButtonList component |
| current | string | - | Currently selected value. Props used to make the component controlled |
| onAction | (() => void) | - | Function called each time an item is clicked |
| .... | - | Extend props from the Mantine Menu component. Used to modify Menu component |