Skip to main content

Crate dioxus_nox_select

Crate dioxus_nox_select 

Source
Expand description

§dioxus-nox-select

⚠️ Disclaimer: This crate was entirely generated by AI (Claude) as part of a personal learning project. It has not been battle-tested in production and may contain bugs or unsound abstractions. Use at your own risk and exercise extreme caution before depending on it in anything that matters.

Headless Select, Combobox, and Multiselect primitives for Dioxus applications.

Follows the WAI-ARIA Combobox pattern and Listbox pattern with proper ARIA roles, keyboard navigation, and data attributes for styling — shipping zero visual styles.

§Layers

LayerItemsDioxus dependency?
TypesAutoComplete, ItemEntry, GroupEntry, ScoredItem, CustomFilterNo
ContextSelectContextYes (Signals, Memos)
Componentsselect::Root, select::Trigger, select::Value, select::Input, select::Content, select::Item, etc.Yes (RSX, context)
NavigationPure navigation functions (internal)No
FilterNucleo-powered fuzzy filtering (internal)No (only nucleo)

§Quick start — Select-only

use dioxus::prelude::*;
use dioxus_nox_select::*;

#[component]
fn App() -> Element {
    rsx! {
        select::Root {
            default_value: "apple",
            select::Trigger {
                select::Value { placeholder: "Choose a fruit…" }
            }
            select::Content {
                select::Item { value: "apple", label: "Apple",
                    select::ItemText { "Apple" }
                }
                select::Item { value: "banana", label: "Banana",
                    select::ItemText { "Banana" }
                }
                select::Item { value: "cherry", label: "Cherry",
                    select::ItemText { "Cherry" }
                }
            }
        }
    }
}
use dioxus::prelude::*;
use dioxus_nox_select::*;

#[component]
fn App() -> Element {
    rsx! {
        select::Root {
            autocomplete: AutoComplete::List,
            select::Input { placeholder: "Search fruits…" }
            select::Content {
                select::Empty { "No results found." }
                select::Item { value: "apple", label: "Apple", "Apple" }
                select::Item { value: "banana", label: "Banana", "Banana" }
                select::Item { value: "cherry", label: "Cherry", "Cherry" }
            }
        }
    }
}

§Quick start — Multiselect

use dioxus::prelude::*;
use dioxus_nox_select::*;

#[component]
fn App() -> Element {
    rsx! {
        select::Root {
            multiple: true,
            select::Trigger {
                select::Value { placeholder: "Select tags…" }
            }
            select::Content {
                select::Item { value: "rust", label: "Rust",
                    select::ItemText { "Rust" }
                    select::ItemIndicator { "✓" }
                }
                select::Item { value: "python", label: "Python",
                    select::ItemText { "Python" }
                    select::ItemIndicator { "✓" }
                }
            }
        }
    }
}

§Data attributes

AttributeComponentValues
data-select-stateRoot"open" | "closed"
data-select-disabledRoot"true" (when disabled)
data-stateTrigger, Item"open"/"closed" or "checked"/"unchecked"
data-highlightedItem"true" (when keyboard-focused)
data-disabledTrigger, Item"true" (when disabled)
data-select-placeholderValue"true" (when showing placeholder)
data-select-inputInput"true"
data-select-contentContent"true"
data-select-item-textItemText"true"
data-select-item-indicatorItemIndicator"true"
data-select-groupGroup"true"
data-select-labelLabel"true"
data-select-separatorSeparator"true"
data-select-emptyEmpty"true"
data-select-clearClearButton"true"

§Keyboard navigation — Select-only

KeyPopup ClosedPopup Open
Space / EnterOpen popupSelect highlighted, close
Arrow DownOpen, nextHighlight next
Arrow UpOpen, prevHighlight prev
HomeOpen, firstHighlight first
EndOpen, lastHighlight last
EscapeClose popup
Printable charType-aheadType-ahead

§Keyboard navigation — Combobox

KeyPopup ClosedPopup Open
Arrow DownOpen, firstHighlight next
Arrow UpHighlight prev
Alt+Arrow DownOpen
EnterSelect highlighted
EscapeClose popup
Home / EndCursorCursor

Modules§

select
Compound component namespace.

Structs§

CustomFilter
GroupEntry
Registration entry for an option group.
ItemEntry
Registration entry for a single select option.
ScoredItem
An item paired with its fuzzy match score and highlight indices.
SelectContext
Shared context for the select compound component tree.

Enums§

AutoComplete
Controls the autocomplete behaviour of an editable combobox.