Skip to content

Select

Pick one option in the text field's look: groups, icons and a second line per option, a gliding highlight, type-ahead, search and a loading state.

oxyn add select
MCP
Claude Haiku 5Fastest · $1 / Mtok
Claude Opus 5Deepest · $5 / Mtok
GPT-6Balanced · needs a key
Local Q 7BFree · on device
Applies to new runs
Dioxus
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        value: "swift",
        label: "Model",
        hint: "Applies to new runs",
        on_change: move |id: String| model.set(id),
    }
}

Rendered from Rust at build time · goes live when visible

When to use

  • Pick one option in the text field's look: model, region, language, fallback provider.
  • Unlike the dropdown menu it holds a *value* and lives in forms.

When not to use

Installation

Select is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add select
Rust
use crate::oxyn::{Select, PRIMITIVES_CSS};

Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{Select, PRIMITIVES_CSS};

Usage

Dioxus · rust
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        value: "swift",
        label: "Model",
        hint: "Applies to new runs",
        on_change: move |id: String| model.set(id),
    }
}

Examples

Closed

A value picked.

Applies to new runs
Code
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        value: "swift",
        label: "Model",
        hint: "Applies to new runs",
        on_change: move |id: String| model.set(id),
    }
}

Open

Open with groups and second lines.

Claude Haiku 5Fastest · $1 / Mtok
Claude Opus 5Deepest · $5 / Mtok
GPT-6Balanced · needs a key
Local Q 7BFree · on device
Applies to new runs
Code
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        value: "swift",
        label: "Model",
        hint: "Applies to new runs",
        on_change: move |id: String| model.set(id),
    }
}

Searchable

A filter field on top.

Filter…
Claude Haiku 5Fastest · $1 / Mtok
Claude Opus 5Deepest · $5 / Mtok
GPT-6Balanced · needs a key
Local Q 7BFree · on device
Applies to new runs
Code
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        value: "swift",
        label: "Model",
        hint: "Applies to new runs",
        searchable: true,
        on_change: move |id: String| model.set(id),
    }
}

Native

The platform's own select (Oxyn plus).

Applies to new runs
Code
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        value: "swift",
        label: "Model",
        hint: "Applies to new runs",
        native: true,
        on_change: move |id: String| model.set(id),
    }
}

Error

Required, nothing chosen.

Code
let options = vec![
    SelectOption::new("swift", "Claude Haiku 5").desc("Fastest · $1 / Mtok").icon("bolt").group("Anthropic"),
    SelectOption::new("deep", "Claude Opus 5").desc("Deepest · $5 / Mtok").icon("brain").group("Anthropic"),
    SelectOption::new("q7", "Local Q 7B").desc("Free · on device").icon("bolt").group("On device"),
];

rsx! {
    Select {
        options: options,
        label: "Model",
        hint: "Applies to new runs",
        error: "Choose a fallback model",
        on_change: move |id: String| model.set(id),
    }
}

API reference

Select

PropTypeDefaultDescription
optionsrequiredVec<SelectOption>—Options.
valueOption<String>Default::default()Value.
placeholderString"Choose…"Placeholder.
labelOption<String>Default::default()Label.
hintOption<String>Default::default()Hint.
errorOption<String>Default::default()Error.
optionalboolDefault::default()"Optional" next to the label.
requiredboolDefault::default()Required.
sizeString"md"`sm` · `md` · `lg`.
disabledboolDefault::default()Disabled.
searchableboolDefault::default()Filter field.
loadingboolDefault::default()Options loading.
upboolDefault::default()Open upward (the host passes the placement result).
openboolDefault::default()Start open (review sheets).
nameOption<String>Default::default()Form field name.
nativeboolDefault::default()Oxyn plus: render a native `<select>` (mobile pickers, very long lists).
nowClockMsDefault::default()Clock (type-ahead window).
on_changeEventHandler<String>—Changed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceor↓Open
↑or↓orHomeorEndMove the highlight
TypeJump to the next match (type-ahead)
EnterChoose
EscClose without changing

Accessibility

  • The trigger is a combobox labelled by the field label and its value; the list is a listbox.
  • aria-activedescendant follows the highlight, so focus stays on the trigger.
  • Esc returns without changing the value.
From the spec

Trigger is a combobox button labelled by the field label + its value; the list is a listbox with options; aria-activedescendant follows the highlight so focus can stay on the trigger. A hidden input carries name / value for forms. Esc returns without changing the value.

Motion & interaction

The list fades in out of a 4 px lift from the field's edge (downward, or upward when it opens above). One highlight glides between rows on spring.snap for the pointer and jumps for keys. The chevron turns half a circle. The chosen check draws itself. The value label rises / drops with a short blur (Arc).

Timing
TransitionDurationEasingReduced motion
List open180 ms fade + 4 px liftease.out80 ms fade
Highlight glide214 ms spring.snapspringjump
Chevron180 msease.outinstant
Value rise / drop180 ms, 5 px, blur 3 → 0ease.outcrossfade 80 ms
Check draw240 msease.outdrawn
Type-ahead window500 ms——
Error nudge300 ms, 4 → 1 pxlinearnone

Responsive behaviour

  • The list opens upward when the host passes up (no room below).
  • Long lists scroll inside a 280 px list; on narrow screens the list matches the trigger width.
Edge cases (spec)

Long option lists scroll inside a 280 px list; the highlighted row scrolls into view. A value not in the options shows the placeholder. Disabled chosen option still shows as the value. Narrow screens: the list matches the trigger width. Type-ahead skips disabled options and wraps.

Notes for AI

  • Import Select from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: SelectEl in oxyn_gpui.
  • Props to set first: options.
  • 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