Select
Recent Value Select
A select that remembers the last choice in localStorage and offers it as a separate "Recent" chip on the next visit — instead of silently pre-selecting it as the default value.
What you can change
- the field caption through label
- the set of options through options
- the storage key through storageKey
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/select-031?lang=en&theme=dark
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…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
Client component: useState holds the applied value and, separately, the recent value that was found. In useEffect the localStorage.getItem(storageKey) read is deferred through setTimeout(…, 0) and wrapped in try/catch, so as not to call setState synchronously in the effect body and not to crash in a browser's private mode. If the stored value is among options and differs from the current one, a chip button labelled "Recent" together with the option's name appears under the select; a click applies it through commitValue, which is also what writes the new value into localStorage on every change of the select. The palette lives in --vibeui-select-031-*.
Tags
- select
- recent
- localStorage
- form
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…