Skip to main content

Options

shadow

The Options element is intended for use inside the Select element and is used to display a dynamically generated list of options that is asynchronously retrieved from the specified URL.

note

For more information on using Options, navigate to the Select element documentation

When to use

Use wje-select-options when you need a consistent WebJET-based implementation for this UI concern.

When not to use

Do not stretch the component beyond its responsibility; compose smaller primitives for edge cases.

Accessibility

Validate keyboard behavior, focus states, contrast, and meaningful labels for interactive elements.

Best Practices

  • Prefer component APIs over direct DOM manipulation.
  • Stick to design tokens and naming conventions.
  • Test components with realistic data before production rollout.

Attributes and Properties

attached

DescriptionControls how attached behaves in the component.
Attributeattached
Typeany
Default-
DescriptionGets the dropdown height attribute.
Attributedropdown-height
Typestring
Default100%

itemText

DescriptionSets the item text attribute.
Attributeitem-text
Typestring
Defaulttext

itemValue

DescriptionSets the item value attribute.
Attributeitem-value
Typestring
Defaultvalue

lazy

DescriptionSets the lazy attribute.
Attributelazy
Typeboolean
Defaultfalse

lazyLoadSize

DescriptionGets the lazy load size attribute.
Attributelazy-load-size
Typenumber
Default10

optionArrayPath

DescriptionSets the option array path attribute.
Attributeoption-array-path
Typestring
Defaultfalse

queryParams

DescriptionSets the queryParams attribute on the element.
Attributequery-params
Typestring
Default-
DescriptionSets the search attribute.
Attributesearch
Typestring
Defaultfalse

searchParamName

DescriptionGets the search parameter name used in queries. Retrieves the value of the 'search-param-name' attribute. If the attribute is not set, it defaults to 'search'.
Attributesearch-param-name
Typestring
Defaultsearch

searchToQueryParams

DescriptionRetrieves the value of the 'search-to-query-params' attribute from the current instance.
Attributesearch-to-query-params
Typestring | null
Defaultfalse

Events

NameDescription
wje-options:loadEmitted when async content finishes loading.

Methods

addOption

DescriptionAdds an option to the element.
Signature(optionData: object) => void

addOptions

DescriptionAdds options to the element.
Signature(optionsData: Array, silent?: boolean) => void

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

No slots available for this component.