docs: add "Disabled items" examples

This commit is contained in:
Eric Liu 2022-06-02 17:55:06 -07:00
commit c690bee810
3 changed files with 45 additions and 3 deletions

View file

@ -112,7 +112,7 @@ items={[
{id: "2", text: "Fax"} {id: "2", text: "Fax"}
]} /> ]} />
### Disabled ### Disabled state
<ComboBox disabled titleText="Contact" placeholder="Select contact method" <ComboBox disabled titleText="Contact" placeholder="Select contact method"
items={[ items={[
@ -120,3 +120,17 @@ items={[
{id: "1", text: "Email"}, {id: "1", text: "Email"},
{id: "2", text: "Fax"} {id: "2", text: "Fax"}
]} /> ]} />
### Disabled items
Use the `disabled` property in the `items` prop to disable specific items.
<ComboBox
titleText="Contact"
placeholder="Select contact method"
items={[
{ id: "0", text: "Slack" },
{ id: "1", text: "Email", disabled: true },
{ id: "2", text: "Fax" },
]}
/>

View file

@ -95,6 +95,20 @@ Set `direction` to `"top"` for the dropdown menu to appear above the input.
{id: "1", text: "Email"}, {id: "1", text: "Email"},
{id: "2", text: "Fax"}]}" /> {id: "2", text: "Fax"}]}" />
### Disabled items
Use the `disabled` property in the `items` prop to disable specific items.
<Dropdown
selectedId="0"
titleText="Contact"
items={[
{ id: "0", text: "Slack" },
{ id: "1", text: "Email", disabled: true },
{ id: "2", text: "Fax" },
]}
/>
### Skeleton ### Skeleton
<DropdownSkeleton /> <DropdownSkeleton />

View file

@ -146,3 +146,17 @@ Set `direction` to `"top"` for the dropdown menu to appear above the input.
{id: "1", text: "Email"}, {id: "1", text: "Email"},
{id: "2", text: "Fax"}]}" {id: "2", text: "Fax"}]}"
/> />
### Disabled items
Use the `disabled` property in the `items` prop to disable specific items.
<MultiSelect
titleText="Contact"
label="Select contact methods..."
items={[
{ id: "0", text: "Slack" },
{ id: "1", text: "Email", disabled: true },
{ id: "2", text: "Fax" },
]}
/>