When false, the well is dimmed (alpha) and non-interactive.
loading
Boolean
false
Swaps the built-in ✕ clear for a 16dp CircularProgressIndicator while an async source is in flight.
shape
Shape
NockerlControlShape
The 12dp control shape (default). Pass NockerlPillShape ONLY for the toolbar / input-bar idiom (pills are reserved, law §4).
The magnifier (leading) and the ✕ clear (trailing, shown when the query is non-empty)
are built in. There are no icon slots to pass; the field is self-contained.
NockerlSearchField is the packaged twin: the recessed .nockerlFieldWell()
chrome, a decorative leading magnifier, and an interactive trailing clear
(NockerlIconButton, flat glyph) that shows only when non-empty. The query is a
Binding; enablement flows from the environment (.disabled(_:)).
Parameter
Type
Default
Description
text *
Binding<String>
n/a
The current query (two-way); filters in place on every keystroke. (The SwiftUI controlled-input idiom for the canon’s value + onChange.)
placeholder
String
"Search"
Hint text, and the default accessible name (search fields carry no visible label).
accessibilityLabel
String?
nil
The field’s accessible name; defaults to placeholder (law §14 persistent name).
loading
Bool
false
Render a small accent spinner in the trailing slot (an async source in flight) in place of the clear.
onSubmit
((String) -> Void)?
nil
Optional explicit submit (Enter / the search key) handed the current query.
.disabled(_:)
modifier
n/a
Enablement flows from the SwiftUI environment (the canon’s enabled), not a parameter. Disabled dims to 55%.
search-field vs. combobox vs. command-palette
Three search-shaped controls, one each per job. search-field (this page) filters
content in place: magnifier + clear + optional submit, no value to commit.
Combobox is a type-to-filter selector; it commits an
option (trailing check, fills the field). Command palette
is the modal ⌘K launcher, a sheet that runs actions, not an inline field. Reach for
search-field whenever you are narrowing a visible list, not picking a value or launching a command.
Cross-platform parity (all three shipped)
Android: shipped.NockerlSearchField (com.dizyx.nockerl.design.components) is
a self-contained field with a built-in magnifier + ✕ clear on the shared recessed-well
treatment, superseding the per-screen OutlinedTextField + Search-icon idiom.
Swift: shipped.NockerlSearchField (NockerlDesign) is the parity twin:
the same contract on the recessed .nockerlFieldWell() chrome, the clear via the
NockerlIconButton icon canon, and the query in real Outfit (.nockerlType).
It resolves the earlier drift: the packaged well uses radius.control (12), not
Voice’s hand-rolled 8, and the affordance is one component, not a per-screen
hand-roll. Voice’s HistoryView field retires on adoption.
Platform delta (law §9): the query is a Binding (SwiftUI controlled input) and
enablement flows from the environment (.disabled(_:)), the idiomatic forms of the
canon’s value / onChange + enabled. .searchable remains the system option for a
toolbar / sidebar search bar bound to the same query.