shadcn.io is an independent project built on shadcn/ui
The button takes the full width of its container. The list opens at that width, so the field lines up with other inputs in a column.
Use it in a form, a side panel, or a narrow screen where a fixed width looks stranded. A toolbar can keep a short Select. In Svelte, Ark UI anchors the list to the button.
Installation
Anatomy

Usage
<div class="w-full"><Combobox collection={collection} onInputValueChange={handleInputValueChange} onValueChange={handleValueChange} positioning={{ getAnchorElement: () => triggerRef }} selectionBehavior="clear" value={value}><ComboboxTrigger class={cn(
buttonVariants({ variant: "outline" }),
"w-full justify-between"
)} bind:ref={triggerRef}>{#if selected}{selected.label}{:else}{"Select country..."}{/if}</ComboboxTrigger><ComboboxContent><ComboboxInput class="w-full" placeholder="Search country..." showTrigger={false} /><ComboboxEmpty>No country found.</ComboboxEmpty><ComboboxList>{#each collection.items as item (item.value)}<ComboboxItem item={item}>{item.label}</ComboboxItem>{/each}</ComboboxList></ComboboxContent></Combobox></div>FAQ
Which classes make it full width?
A wrapper div with w-full, and w-full justify-between on the trigger so the label sits at the start and the chevron at the end.
How does the list match the button's width?
ComboboxContent reads the width of the element it's anchored to, so a wider button gives a wider list without a width class on the popup.
It's anchored to the trigger through positioning.getAnchorElement.
What can I select?
United States, United Kingdom, Canada, Australia and Germany. The search box says Search country..., and No country found. shows when nothing matches.
API Reference
Combobox
Sets collection={collection}, onInputValueChange={handleInputValueChange}, onValueChange={handleValueChange}, positioning, getAnchorElement and cn. The rest is on the Combobox page.





