Skip to main content

Option

shadow

The Option element represents the individual options within the Select component. It is similar to the standard HTML select element and allows users to make one or more selections based on the configuration of the select component. These elements can be dynamically populated and are designed to work seamlessly with the wj-select component's own logic, including features such as multiple selection and custom styling.

For information on using Option, navigate to the Select. element documentation.

Attributes and Properties

selected

DescriptionIndicates whether the option is selected.
Attributeselected
Typeboolean
Defaultundefined

value

DescriptionThe option value that is used when the form is submitted.
Attributevalue
Typestring
Defaultundefined

text

DescriptionThe textual content of the option that is displayed to the user.
Attributeundefined
Typestring
Defaultundefined

disabled

DescriptionIf true, the option is disabled and cannot be selected.
Attributedisabled
Typeboolean
Defaultundefined

Events

NameDescription
wje-option:changeCalled when the option is clicked.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
nativeNative part options.

CSS Custom Properties

NameDescription
--wje-option-padding-topTop indentation options.
--wje-option-padding-bottomLower indentation options.
--wje-option-highlightedThe color of the highlighting option when the mouse is hovered over.

Slots

NameDescription
``Default slot for content options.
startSlot for content at the beginning of the option.
endSlot for content at the end of the option.