docs(SelectMenu): add section customization on clearable prop

This commit is contained in:
rdjanuar
2024-11-12 19:04:42 +07:00
parent 5a414eb55a
commit 21939ed333
2 changed files with 126 additions and 1 deletions

View File

@@ -161,7 +161,7 @@ componentProps:
::
## Clearable
Use the `clearable` prop to enable the remove selected option.
The `clearable` prop allows users to easily remove their selected option(s) with a clear button.
::component-example
---
@@ -171,6 +171,26 @@ componentProps:
---
::
### Customization
#### Slot Props
The slot provides four key props:
| Prop | Type | Description |
|------|------|-------------|
| `selected` | `Object` | The currently selected value/item in the component |
| `disabled` | `Boolean` | Whether the component is in a disabled state |
| `loading` | `Boolean` | Whether the component is in a loading state |
| `onClear` | `Function` | Callback function to clear the selected value when the clear button is clicked |
::component-example
---
component: 'select-menu-example-clearable-customization'
componentProps:
class: 'w-full lg:w-52'
---
::
## Creatable
Use the `creatable` prop to enable the creation of new options when the search doesn't return any results (only works with `searchable`).