Skip to content
Back

Expanding searchPro

An icon that morphs into a search field with grouped, highlighted results beneath; the panel tracks the field's width; Enter picks and folds it back.

oxyn add expanding-search
Projects
Atlas roadmap12 runs
Docs
Atlas onboarding guide
2 results
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • A search that takes no room until needed: an icon in a toolbar that becomes a field with results, then folds back after a pick.

When not to use

  • A search input whose clear button scales in inside a reserved slot so the width never shifts: use Search field instead.
  • Search and run anything from one field: use Command palette instead.
  • An app sidebar: use Sidebar instead.

Installation

Expanding search is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add expanding-search

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Results

Expanded with results.

Projects
Atlas roadmap12 runs
Docs
Atlas onboarding guide
2 results
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Recent

Expanded, recent searches.

Recent
atlas roadmap
webhook retries
2 results
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Icon

Folded into its icon.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Start

Grows to the right.

Projects
Atlas roadmap12 runs
Docs
Atlas onboarding guide
2 results
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

ExpandingSearch

PropTypeDefaultDescription
labelrequiredString—Names the button, field and results.
itemsrequiredVec<Command>—Items (group = section).
suggestionsVec<Command>Default::default()Shown before typing.
suggestions_labelString"Recent"Heading for suggestions.
placeholderOption<String>Default::default()Placeholder (defaults to the label).
expanded_widthf32360.0Widest the field grows px.
max_resultsusize6Most results.
anchorString"end"`start` · `center` · `end`.
empty_hintString"Try a shorter word or check the spelling."Tip under the empty state.
default_expandedboolDefault::default()Start expanded.
queryStringDefault::default()Initial query.
hotkeyboolDefault::default()⌘K expands it (while focus is inside the host).
lanef32420.0Lane width px (the container it grows in).
on_selectEventHandler<String>—Picked (id).
on_expanded_changeEventHandler<bool>—Expanded changed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceOn the icon: expand
↑or↓Move (wraps)
EnterPick
EscFold back
⌘KExpand (Oxyn plus)

Accessibility

  • Combobox with aria-activedescendant over a listbox of labelled groups.
  • Counts and empty states are announced; the folded field is not in the tab order.
From the spec

The icon is a labelled button; the field is a combobox with aria-activedescendant; groups are labelled; counts are announced.

Motion & interaction

The icon morphs into the field: width grows with a soft spring away from the anchor and corners square off; the panel drops in and tracks the field width.

Timing
TransitionDurationEasingReduced motion
Expand / fold380 msspring (1.15)instant
Panel in240 msease.outfade

Responsive behaviour

  • Grows to the smaller of its width and its container; the panel caps at min(22 rem, 60 vh).
Edge cases (spec)

The field never grows past its container. Results cap at min(22 rem, 60 vh). Folding clears the query.

Notes for AI

  • Import ExpandingSearch from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: ExpandingSearchEl in oxyn_gpui.
  • Props to set first: label, items.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI