shadcn.io is an independent project built on shadcn/ui
Project Alpha and Project Beta sit under Recent with a clock icon. Project Charlie, Project Delta, and Project Echo follow under All Projects.
Use it in a switcher where people go back to the same few projects. Files, rather than projects, can use the same recent group on a Combobox. In Svelte, Ark UI does not know which projects are recent.
Installation
Anatomy

Usage
<Combobox collection={collection} onInputValueChange={handleInputValueChange} onValueChange={handleValueChange} positioning={{ getAnchorElement: () => triggerRef }} selectionBehavior="clear" value={value}><ComboboxTrigger class={cn(
buttonVariants({ variant: "outline" }),
"w-[250px] justify-between"
)} bind:ref={triggerRef}>{#if selected}{selected.label}{:else}{"Select project..."}{/if}</ComboboxTrigger><ComboboxContent><ComboboxInput class="w-full" placeholder="Search projects..." showTrigger={false} /><ComboboxEmpty>No project found.</ComboboxEmpty><ComboboxList>{#each groups as [group, items], index (group)}<ComboboxGroup heading={group}>{#each items as item (item.value)}<ComboboxItem class="gap-2" item={item}>{#if item.group === "Recent"}<ClockIcon aria-hidden="true" class="size-3 opacity-50" />{:else}{/if}{item.label}</ComboboxItem>{/each}</ComboboxGroup>{#if index < groups.length - 1}<ComboboxSeparator />{:else}{/if}{/each}</ComboboxList></ComboboxContent></Combobox>FAQ
How are Recent and All Projects built?
Two ComboboxGroups with a ComboboxSeparator between them. Each project belongs to one of them.
How is the clock drawn?
A ClockIcon at size-3 opacity-50, rendered only in the Recent rows and hidden from screen readers.
Why aren't recent projects listed twice?
All Projects lists only those that aren't recent, so each project has one row and one value.
Does the search cover both groups?
Yes. A group with no matches is hidden, and No project found. shows when neither has one.
How do I keep Recent up to date?
The demo's list is fixed. In an app, store the last few picks, newest first, and build both groups from them on each render. Recent Selections Section shows a version that updates as you pick.
API Reference
Combobox
Sets collection={collection}, onInputValueChange={handleInputValueChange}, onValueChange={handleValueChange}, positioning, getAnchorElement and cn. The rest is on the Combobox page.





