(react) add disable property to select option

Based on recent feedbacks, this feature was needed for consumer apps.

Resolve #60
This commit is contained in:
Nathan Vasse
2023-05-19 12:09:14 +02:00
committed by NathanVss
parent c11727976c
commit c93c8d2a2f
8 changed files with 119 additions and 14 deletions

View File

@@ -26,6 +26,7 @@ The available options must be given via the `options` props. It is an array of o
code={`{
label: string
value?: string
disabled?: boolean;
}`}
/>
@@ -83,6 +84,15 @@ By default, the select is clearable ( the cross icon on the right is shown ). Yo
<Story id="components-forms-select-mono--not-clearable"/>
</Canvas>
## Disabled options
You can disable some options by using the `disabled` props on the `Option` object.
<Canvas sourceState="shown">
<Story id="components-forms-select-mono--disabled-options"/>
</Canvas>
## Controlled / Non Controlled
Like a native select, you can use the Select component in a controlled or non controlled way. You can see the example below