Combobox

Recent First

A combobox with recent values: the latest choices rise into their own block on top, disappear from the main list and can be cleared in one press.

React + Tailwind, shadcn-compatible: press “Copy for AI” and your Cursor or Claude Code agent installs it with the shadcn CLI.

What you can change

  • the list content through options and the starting history through defaultRecent
  • the length of the recent block through recentLimit
  • the section captions through recentLabel and allLabel

A link for your AI agent: preview, code and instructions.

Preview

1440pxHost theme
Recent First — A combobox with recent values: the latest choices rise into their own block on top, disappear from the main list and can be cleared in one press.

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.
AI
1Pick it here

put this on the home page as the hero:

https://vibeui.club/c/combobox-006?lang=en&theme=dark

2Paste into the chat
3Get it in your project

Not sure where to paste it? Step-by-step guide

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

Loading…

How to use

<Combobox006
  label="Delivery city"
  options={["Moscow", "Kazan", "Samara"]}
  defaultRecent={["Kazan"]}
  recentLimit={3}
  onSelect={(value) => console.log(value)}
/>

A sample call. The agent installs the component itself from the registry via the “Copy for AI” link.

Settings

Recent count
recentLimit · default: 3
Block heading
recentLabel · default: Recent
Accent
accent · default: theme colour
Background
background · default: theme colour

FAQ

How do I add Recent First with Cursor or Claude Code?
Press “Copy for AI” on this page and paste it into your agent's chat. The instruction contains the shadcn CLI install command, the dependencies and what to keep, so the agent installs this exact component instead of recreating a lookalike.
What does Recent First depend on?
No npm packages beyond React and Tailwind CSS.
What can I change in Recent First?
Adapt: the list content through options and the starting history through defaultRecent; the length of the recent block through recentLimit; the section captions through recentLabel and allLabel. Keep as installed: the local --vibeui-combobox-006-* palette — do not swap it for your theme tokens; removing recent values from the main list: a duplicated row confuses both the eye and the arrow count; the continuous row numbering across both blocks — aria-activedescendant depends on it.
Is Recent First free?
Yes. The preview is open without an account; with a free account you can copy up to 20 components a month.

For developers

npx shadcn@latest add https://vibeui.club/r/pro/combobox-006.json

This command needs a signed link: sign in and open “Component source” below — it issues a working link valid for 30 minutes. All install options

Technical notes

The component is self-contained: one file, no dependencies, its own --vibeui-combobox-006-* palette. Client component: useState holds the list of recent values, the query, the value and the cursor, and useMemo assembles the two groups and the shared flat order. The selected value moves to the front of the recent list and is trimmed by recentLimit; it is excluded from the main block so that one row does not appear twice and break the arrow count. The section headings are li elements with role="presentation", and the clear control lives right in the heading. The clock icon is drawn with pseudo-elements on a circle: an SVG file would be redundant here. The ARIA roles are complete and the cursor is carried by aria-activedescendant.

Tags

  • combobox
  • recent
  • history
  • keyboard
Component source

The same file your agent installs. Here in case you would rather copy it by hand.

Loading…