The component reads your objects — you only tell it which property holds the value, the label, the icon, and so on. Anything a plain property can't express becomes a callback.
DA01 Data shapes
Member attributes map your object properties onto the control.
value-member,display-value-memberandicon-memberpoint at properties of each option (code,name,flaghere).- Every member has a callback counterpart —
getValueCallback,getDisplayValueCallback,getIconCallback, … — for computed values. Callbacks are set as properties in JS (never attributes) and take precedence over the matching member. - An array of
[key, value]tuples is auto-detected — no members required.
DA02 Form value-format
A named control auto-creates hidden inputs so it submits like any native field.
Select a few items, then inspect the DOM — hidden inputs named “stack” appear in the light DOM and update live.
- With a
name, the component writes the selection into auto-created hidden<input>s in the light DOM, so a normalFormData/ form submit picks it up. value-formatcontrols the serialization:json→["html","css"],csv→html,css,array→ one repeatedstack[]input per value.
DA03 Imperative API (v2.0.0)
Drive the dropdown, the search box and scrolling from your own code.
Last getValue():
(not read yet) open()/close()/toggle()and theisOpengetter/setter drive the dropdown — new in v2.0.0.search(term)applies a query as if typed (without opening the dropdown),searchTextreads it back, andclearSearch()restores the full list — new in v2.0.0.scrollToIndex/scrollToValue/scrollToGroupbring an option into view (they returnfalsewhen it is filtered out) — new in v2.0.0.- See the full list on the Methods page.
DA04 · Deferred initialization (v2.1.0)
A custom element upgrades the instant its script loads and paints with the component's default styles, so anything you wire in afterward — a customStylesCallback, your options — lands a beat late and the badges visibly
restyle: the classic flash. The defer attribute holds the first render until
you release it.
held — waiting for data…- While
deferis set the element builds nothing on upgrade (it only reserves space via:host([defer]:not([is-ready]))), so you wireoptions, callbacks and listeners first. ready()— or removing thedeferattribute, which suits server-driven frameworks like Phoenix LiveView — builds the picker once, with the purple pre-selected badges appearing in one shot. The gate is latched.isReadyis reflected as anis-readyattribute, and a one-timereadyevent fires right after the first build. See the methods page.