A wrapper element that augments a <select>
with previous/next controls.
Import and register the <select-control>
custom element, upgrading any
instances already in the DOM:
import SelectControl from 'literal/documentation/templates/select-control.js';
The <select-control>
element wraps a <select>
, augmenting it
with styleable previous/next buttons and left/right arrow keyboard behaviour:
<select-control>
<select>...</select>
</select-control>
Default content of previous and next buttons may be overridden with HTML
assigned to the previous-button
and next-button
slots:
<select-control>
<span slot="previous-button">☚</span>
<span slot="next-button">☛</span>
<select>...</select>
</select-control>
Note that the element itself is not a custom form element (it has no value
property and does not set any form data in its internals).
::part(previous-button)
::part(next-button)
--button-width
.5rem; Width of decrement/increment buttons.
slot="previous-button"
Replace default content of the decrement button ("◀"
) with custom HTML.
slot="next-button"
Replace default content of the increment button ("▶"
) with custom HTML.
Support development: Sponsor
github.com/stephband/form-elements
github.com/stephband/form-elements/issues
Built by Stephen Band for Cruncher.
Documentation set in Euclid
and Martian Mono. Fonts
used for documentation not included as part of the license covering the
use of select-control
.