Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
Spectrum website
Spectrum web components
npm
GitHub
Comboboxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.
.spectrum-PickerButton
instead of a .spectrum-Picker
.spectrum-Combobox-textfield
is required on the Textfield outer element (.spectrum-Textfield
).spectrum-Combobox-input
is required on the <input>
element inside of Textfields (.spectrum-Textfield-input
).spectrum-Combobox-button
is required on the FieldButton (.spectrum-ActionButton spectrum-ActionButton--sizeM
)Validity and focus must be bubbled up to the parent so descendants siblings can be styled. Implementations should add the following classes to the .spectrum-Combobox
parent class in the following situations:
.is-focused
.is-keyboardFocused
.is-valid
.is-invalid
.is-disabled
.spectrum-Combobox-textfield
and include a [disabled]
attribute to the .spectrum-Combobox-button
.is-loading
Putting instructions for how to complete an input, requirements, or any other essential information into placeholder text is not accessible. Once a value is entered, placeholder text is no longer viewable; if someone is using an automatic form filler, they will never get the information in the placeholder text.
Instead of placeholder text, use the help text description to convey requirements or to show any formatting examples that would help user comprehension. If there's placeholder text and help text at the same time, it becomes redundant and distracting, especially if they're communicating the same thing.
Comboboxes have a read-only option for when content in the disabled state still needs to be shown. This allows for content to be copied, but not interacted with or changed. A combobox does not have a read-only option if no selection has been made. To enable this feature, add the .isReadOnly
class to the combobox. To enable this feature, add the .isReadOnly class to the combobox. Then within the nested textfield component, add the .isReadOnly class and readonly attribute to the <input>
element.
The component accepts the following inputs (properties):
Name | Description | Default |
---|---|---|
Component | ||
Size* | string | - |
Quiet styling | boolean | - |
Show field label | boolean | - |
State | ||
Open | boolean | - |
Invalid | boolean | - |
Focused | boolean | - |
Keyboard Focused | boolean | - |
Loading | boolean | - |
Disabled | boolean | - |
Read-only | boolean | - |
Content | ||
Value | The value shows the option that a user has selected. string | - |
These are empty CSS custom property hooks available in this component that enable one-off customizations specific to a product implementation.
Property |
---|
--mod-combobox-alert-icon-color |
--mod-combobox-background-color-default |
--mod-combobox-background-color-disabled |
--mod-combobox-background-color-focus |
--mod-combobox-background-color-focus-hover |
--mod-combobox-background-color-hover |
--mod-combobox-background-color-key-focus |
--mod-combobox-block-size |
--mod-combobox-block-spacing-edge-to-alert |
--mod-combobox-block-spacing-edge-to-progress-circle |
--mod-combobox-border-color-default |
--mod-combobox-border-color-disabled |
--mod-combobox-border-color-focus |
--mod-combobox-border-color-focus-hover |
--mod-combobox-border-color-hover |
--mod-combobox-border-color-invalid-default |
--mod-combobox-border-color-invalid-focus |
--mod-combobox-border-color-invalid-focus-hover |
--mod-combobox-border-color-invalid-hover |
--mod-combobox-border-color-invalid-key-focus |
--mod-combobox-border-color-key-focus |
--mod-combobox-border-radius |
--mod-combobox-border-width |
--mod-combobox-button-inline-offset |
--mod-combobox-button-width |
--mod-combobox-focus-indicator-color |
--mod-combobox-focus-indicator-gap |
--mod-combobox-focus-indicator-thickness |
--mod-combobox-font-color-default |
--mod-combobox-font-color-disabled |
--mod-combobox-font-color-focus |
--mod-combobox-font-color-focus-hover |
--mod-combobox-font-color-hover |
--mod-combobox-font-color-key-focus |
--mod-combobox-font-color-placeholder |
--mod-combobox-font-family |
--mod-combobox-font-size |
--mod-combobox-font-style |
--mod-combobox-font-weight |
--mod-combobox-icon-size |
--mod-combobox-inline-size |
--mod-combobox-line-height |
--mod-combobox-min-inline-size |
--mod-combobox-readonly-border-color-disabled |
--mod-combobox-readonly-input-border-color |
--mod-combobox-spacing-block-end-edge-to-text |
--mod-combobox-spacing-block-start-edge-to-text |
--mod-combobox-spacing-edge-to-menu |
--mod-combobox-spacing-inline-end-edge-to-text |
--mod-combobox-spacing-inline-icon-to-button |
--mod-combobox-spacing-inline-start-edge-to-text |
--mod-combobox-spacing-label-to-combobox |
latest
next
s2-foundations