Native single-choice select field with label, description, validation state, options, optional placeholder, and one canonical value-change event.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
catalog/contracts/select.ymlsource of truth · verbatim
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity:name: Selecttag: wyrd-selectpackage: wyrd.component.selecttitle: Selectsummary: Native single-choice select field with label, description, validation state, options, optional placeholder, and one canonical value-change event.relationships:related-to: - quality-parity-and-gatesclassification:category: form-fieldcomposition: multi-slotinteractive: truetarget-strategy:react: requiredflutter: requiredsurface:properties: - name: valuetype:kind: stringrequired: falsecontrolled: trueserializable: truesummary: Controlled selected option value. - name: default-valuetype:kind: stringrequired: falseserializable: truesummary: Initial uncontrolled selected option value. - name: optionstype:kind: arrayitem:kind: objectfields:value:kind: stringlabel:kind: stringdescription:kind: stringdisabled:kind: booleanrequired: falsedefault: []serializable: truesummary: Ordered selectable option items. - name: placeholdertype:kind: stringrequired: falseserializable: truesummary: Disabled placeholder option shown when no value is selected. - name: is-disabledtype:kind: booleanrequired: falsedefault: falsereflects: trueserializable: truesummary: Prevents changing selection and exposes disabled semantics. - name: is-requiredtype:kind: booleanrequired: falsedefault: falsereflects: trueserializable: truesummary: Marks the field as requiring one selected option. - name: is-invalidtype:kind: booleanrequired: falsedefault: falsereflects: trueserializable: truesummary: Marks the selection as invalid and associates the error slot.slots: - name: labelrequired: truecardinality: exactly-oneaccepts: - textsummary: Visible label and accessible-name source. - name: descriptionrequired: falsecardinality: zero-or-oneaccepts: - textsummary: Help text associated with the select. - name: errorrequired: falsecardinality: zero-or-oneaccepts: - textsummary: Validation error associated when is-invalid is true.events: - name: value-changepayload:value:kind: stringaction:kind: action-refbubbles: truecomposed: truecancelable: falsesummary: Canonical value-change event carrying the selected option value.states: - name: defaultsource: platformsummary: Enabled field with no invalid or disabled state. - name: selectedsource: propertysummary: State when an option matching value or default-value is selected. - name: focus-visiblesource: platformsummary: Keyboard-visible focus state. - name: disabledsource: propertysummary: Disabled state derived from is-disabled or option disabled. - name: invalidsource: propertysummary: Invalid state derived from is-invalid. - name: requiredsource: propertysummary: Required state derived from is-required.parts: - name: rootsummary: Field container.slots: - label - description - error - name: labelsummary: Label text.slots: - label - name: controlsummary: Native select control. - name: descriptionsummary: Description text.slots: - description - name: errorsummary: Error text.slots: - errortokens:root:gap: spacing.xslabel:color: color.on-surfacetext: typography.label-mdcontrol:background: color.surfaceforeground: color.on-surfaceplaceholder: color.on-surface-variantborder-color: color.outlineborder-color-focus: color.primaryborder-color-invalid: color.errorborder-width: 1pxradius: rounded.smpadding-x: spacing.mdpadding-y: spacing.smtext: typography.body-mddescription:color: color.on-surface-varianttext: typography.body-mderror:color: color.errortext: typography.body-mdmessages: []obligations:accessibility:role: comboboxname: Label slot provides the accessible name.description: Description and error slots are programmatically associated with the control.keyboard: - Native select follows platform selection keys. - Tab moves focus into and out of the field in document order.semantics: - Required, invalid, and disabled states are exposed through platform semantics. - Error text is associated only when invalid. - Each option exposes selected and disabled state through native select semantics.behavior:model: inputinteractions: - Selecting an enabled option emits value-change with that option value. - Disabled selects and disabled options do not change value. - Controlled value wins over default-value.hostEffects: - Dispatch value-change event. - Bind value to SDUI form state when present.conditions: - rtl - reduced-motion - cvd-deuteranopia - density-compact - text-expansionsdui:status: serializableserializableProperties: - value - default-value - options - placeholder - is-disabled - is-required - is-invalidserializableSlots: - label - description - erroreventBindings: - value-changenotes: Options serialize as ordered records; value-change serializes to a named binding/action channel.examples: - name: emptystate: defaultproperties:placeholder: Choose a contact methodoptions: - value: emaillabel: Email - value: phonelabel: Phone - value: maillabel: Mailslots:label: Contact methoddescription: Choose how collaborators should reach you. - name: selectedstate: selectedproperties:default-value: emailoptions: - value: emaillabel: Email - value: phonelabel: Phone - value: maillabel: Mailslots:label: Contact method - name: invalidstate: invalidproperties:is-invalid: trueis-required: trueplaceholder: Choose a contact methodoptions: - value: emaillabel: Email - value: phonelabel: Phone - value: maillabel: Mailslots:label: Contact methoderror: Select a contact method.
01
Examples
Generated from the contract's examples block.
Previews are the published @wyrd-company/react component, themed by the
brand's role tokens — flip the site's light/dark toggle and they follow.
emptystate: default
Choose how collaborators should reach you.
Usage
import { WyrdSelect } from"@wyrd-company/react";
<WyrdSelect placeholder="Choose a contact method" options={[{"value":"email","label":"Email"},{"value":"phone","label":"Phone"},{"value":"mail","label":"Mail"}]} label="Contact method" description="Choose how collaborators should reach you." />
// events: onValueChange
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdSelect(
placeholder: 'Choose a contact method',
options: [{"value":"email","label":"Email"},{"value":"phone","label":"Phone"},{"value":"mail","label":"Mail"}],
label: Text('Contact method'),
description: Text('Choose how collaborators should reach you.'),
)
// events: onChanged
Disabled placeholder option shown when no value is selected.
is-disabled
boolean
false
Prevents changing selection and exposes disabled semantics.
is-required
boolean
false
Marks the field as requiring one selected option.
is-invalid
boolean
false
Marks the selection as invalid and associates the error slot.
03
Slots & events
Slot
Cardinality
Accepts
Summary
label
exactly-one
text
Visible label and accessible-name source.
description
zero-or-one
text
Help text associated with the select.
error
zero-or-one
text
Validation error associated when is-invalid is true.
Event
Payload
Summary
value-change
value, action
Canonical value-change event carrying the selected option value.
04
Tokens
The contract's token bindings. Open the shared contextual sidebar from any example;
primary swatches reflect the color you pick there. Error swatches show the active
preset's values; editing any knob switches to custom and resets error to TWW · Ink.
Binding
Token
root.gap
spacing.xs
label.color
color.on-surface
label.text
typography.label-md
control.background
color.surface
control.foreground
color.on-surface
control.placeholder
color.on-surface-variant
control.border-color
color.outline
control.border-color-focus
color.primary
control.border-color-invalid
color.error
control.border-width
1px
control.radius
rounded.sm
control.padding-x
spacing.md
control.padding-y
spacing.sm
control.text
typography.body-md
description.color
color.on-surface-variant
description.text
typography.body-md
error.color
color.error
error.text
typography.body-md
05
States
State
Source
Summary
default
platform
Enabled field with no invalid or disabled state.
selected
property
State when an option matching value or default-value is selected.
focus-visible
platform
Keyboard-visible focus state.
disabled
property
Disabled state derived from is-disabled or option disabled.
invalid
property
Invalid state derived from is-invalid.
required
property
Required state derived from is-required.
06
Accessibility
From the contract's accessibility obligations. Role combobox; Label slot provides the accessible name.
Native select follows platform selection keys.
Tab moves focus into and out of the field in document order.
Required, invalid, and disabled states are exposed through platform semantics.
Error text is associated only when invalid.
Each option exposes selected and disabled state through native select semantics.