The render callbacks return raw HTML (or a DOM element) so you can build rich option rows,
restyle badges, or replace a whole pill with a card. They are set imperatively on the element
in setup(el), never as attributes.
Security: these callbacks emit raw HTML into the component. Never interpolate
untrusted data without escaping it first. See Security for the escaping contract.
CR01 Rich option rows
renderOptionContentCallback builds a multi-line row with icon, label, and subtitle.
Open the dropdown β each row renders your HTML instead of the plain label.
Quick usage
renderOptionContentCallbackreceives(item, ctx)and returns the row's inner HTML.- In v2.0.0 the
ctxis presentation-aware (ctx.isFullscreen), so you can render leaner rows on phones where the dropdown goes fullscreen.
The option callback
CR02 Whole-badge rendering (v2.0.0)
renderBadgeCallback replaces the entire pill β here a Bootstrap badge with its own remove button.
Select a few countries β each selection becomes a fully custom badge you own.
Quick usage
renderBadgeCallbackis new in v2.0.0 and owns the whole badge, not just its content. Returnnullto fall back to the default pill for an item.- Any element inside your badge with
data-action="remove"triggers deselect β the component wires it up for you, no event handlers required. renderBadgeContentCallbackis the lighter alternative when you only want to change the content inside the built-in pill.
The whole-badge callback