1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
//! # 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](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/)
//! and [Listbox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/listbox/)
//! with proper ARIA roles, keyboard navigation, and data attributes for
//! styling — shipping **zero visual styles**.
//!
//! ## Layers
//!
//! | Layer | Items | Dioxus dependency? |
//! |-------|-------|--------------------|
//! | **Types** | [`AutoComplete`], [`ItemEntry`], [`GroupEntry`], [`ScoredItem`], [`CustomFilter`] | No |
//! | **Context** | [`SelectContext`] | Yes (Signals, Memos) |
//! | **Components** | [`select::Root`], [`select::Trigger`], [`select::Value`], [`select::Input`], [`select::Content`], [`select::Item`], etc. | Yes (RSX, context) |
//! | **Navigation** | Pure navigation functions (internal) | No |
//! | **Filter** | Nucleo-powered fuzzy filtering (internal) | No (only nucleo) |
//!
//! ## Quick start — Select-only
//!
//! ```rust,ignore
//! 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" }
//! }
//! }
//! }
//! }
//! }
//! ```
//!
//! ## Quick start — Combobox with search
//!
//! ```rust,ignore
//! 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
//!
//! ```rust,ignore
//! 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
//!
//! | Attribute | Component | Values |
//! |-----------|-----------|--------|
//! | `data-select-state` | Root | `"open"` \| `"closed"` |
//! | `data-select-disabled` | Root | `"true"` (when disabled) |
//! | `data-state` | Trigger, Item | `"open"/"closed"` or `"checked"/"unchecked"` |
//! | `data-highlighted` | Item | `"true"` (when keyboard-focused) |
//! | `data-disabled` | Trigger, Item | `"true"` (when disabled) |
//! | `data-select-placeholder` | Value | `"true"` (when showing placeholder) |
//! | `data-select-input` | Input | `"true"` |
//! | `data-select-content` | Content | `"true"` |
//! | `data-select-item-text` | ItemText | `"true"` |
//! | `data-select-item-indicator` | ItemIndicator | `"true"` |
//! | `data-select-group` | Group | `"true"` |
//! | `data-select-label` | Label | `"true"` |
//! | `data-select-separator` | Separator | `"true"` |
//! | `data-select-empty` | Empty | `"true"` |
//! | `data-select-clear` | ClearButton | `"true"` |
//!
//! ## Keyboard navigation — Select-only
//!
//! | Key | Popup Closed | Popup Open |
//! |-----|-------------|------------|
//! | Space / Enter | Open popup | Select highlighted, close |
//! | Arrow Down | Open, next | Highlight next |
//! | Arrow Up | Open, prev | Highlight prev |
//! | Home | Open, first | Highlight first |
//! | End | Open, last | Highlight last |
//! | Escape | — | Close popup |
//! | Printable char | Type-ahead | Type-ahead |
//!
//! ## Keyboard navigation — Combobox
//!
//! | Key | Popup Closed | Popup Open |
//! |-----|-------------|------------|
//! | Arrow Down | Open, first | Highlight next |
//! | Arrow Up | — | Highlight prev |
//! | Alt+Arrow Down | Open | — |
//! | Enter | — | Select highlighted |
//! | Escape | — | Close popup |
//! | Home / End | Cursor | Cursor |
// Re-export types at crate root for `use dioxus_nox_select::*`.
pub use SelectContext;
pub use ;
/// Compound component namespace.
///
/// ```rust,ignore
/// select::Root {
/// select::Trigger { select::Value { placeholder: "Pick one…" } }
/// select::Content {
/// select::Item { value: "a", label: "A", "A" }
/// }
/// }
/// ```