Composition wrapper that visually attaches leading or trailing addons to one Text Field.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
catalog/contracts/input-group.ymlsource of truth · verbatim
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity:name: InputGrouptag: wyrd-input-grouppackage: wyrd.component.input-grouptitle: Input Groupsummary: Composition wrapper that visually attaches leading or trailing addons to one Text Field.relationships:related-to: - quality-parity-and-gatesclassification:category: form-fieldcomposition: multi-slotinteractive: falsetarget-strategy:react: requiredflutter: requiredsurface:properties: []slots: - name: fieldcontent: truerequired: truecardinality: exactly-oneaccepts: - componentsummary: Text Field that retains label, value, validation, disabled state, and editing behavior. - name: leading-addonrequired: falsecardinality: zero-or-oneaccepts: - text - icon - componentsummary: Text, icon, or button visually attached before the text control and associated as its description. - name: trailing-addonrequired: falsecardinality: zero-or-oneaccepts: - text - icon - componentsummary: Text, icon, or button visually attached after the text control and associated as its description.events: []states: - name: defaultsource: platformsummary: Enabled Text Field with one or more attached addons. - name: disabledsource: platformsummary: Visual state inherited from the disabled Text Field. - name: invalidsource: platformsummary: Error visual state inherited from the invalid Text Field.parts: - name: rootsummary: Field-level composition wrapper.slots: - field - leading-addon - trailing-addon - name: leading-addonsummary: Visually fused leading addon.slots: - leading-addon - name: trailing-addonsummary: Visually fused trailing addon.slots: - trailing-addontokens:addon:background: color.surface-containerforeground: color.on-surface-variantborder-color: color.outlineborder-width: 1pxpadding-x: spacing.mdpadding-y: spacing.smtext: typography.body-mdbackground-disabled: color.disabledforeground-disabled: color.on-surface-variantradius: rounded.smmessages: []obligations:accessibility:role: nonekeyboard: - The Text Field and interactive addon children retain native keyboard behavior and document-order focus.semantics: - Text addon content is programmatically associated with the Text Field control as descriptive content. - Icon-only and button addons retain their own accessible names. - The wrapper adds no form-control role and does not duplicate Text Field semantics.behavior:model: statelessinteractions: - Text Field owns value, editing, focus, disabled, required, and invalid behavior. - Interactive addons own their activation behavior. - Disabled and invalid visuals follow the composed Text Field state.hostEffects: - Associate addon descriptions with the composed Text Field where the target exposes association hooks.conditions: - rtl - reduced-motion - cvd-deuteranopia - density-compact - text-expansionsdui:status: serializableserializableProperties: []serializableSlots: - field - leading-addon - trailing-addoneventBindings: []notes: Input Group serializes composition only; the nested Text Field retains its own value and event bindings.examples: - name: leading-textstate: defaultproperties: {}slots:field: Website Text Fieldleading-addon: https:// - name: trailing-textstate: defaultproperties: {}slots:field: Price Text Fieldtrailing-addon: USD - name: action-addonstate: defaultproperties: {}slots:field: Search Text Fieldtrailing-addon: Search buttonoverrides:react:slots:field: childrenleading-addon: leadingAddontrailing-addon: trailingAddonflutter:slots:field: childleading-addon: leadingAddontrailing-addon: trailingAddon
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.
leading-textstate: default
https://
Usage
import { WyrdInputGroup } from"@wyrd-company/react";
<WyrdInputGroup leadingAddon="https://">
Website Text Field
</WyrdInputGroup>
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdInputGroup(
child: Text('Website Text Field'),
leadingAddon: Text('https://'),
)
trailing-textstate: default
USD
Usage
import { WyrdInputGroup } from"@wyrd-company/react";
<WyrdInputGroup trailingAddon="USD">
Price Text Field
</WyrdInputGroup>
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdInputGroup(
child: Text('Price Text Field'),
trailingAddon: Text('USD'),
)
action-addonstate: default
Search button
Usage
import { WyrdInputGroup } from"@wyrd-company/react";
<WyrdInputGroup trailingAddon="Search button">
Search Text Field
</WyrdInputGroup>
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdInputGroup(
child: Text('Search Text Field'),
trailingAddon: Text('Search button'),
)
02
Slots & events
Slot
Cardinality
Accepts
Summary
field
exactly-one
component
Text Field that retains label, value, validation, disabled state, and editing behavior.
leading-addon
zero-or-one
text, icon, component
Text, icon, or button visually attached before the text control and associated as its description.
trailing-addon
zero-or-one
text, icon, component
Text, icon, or button visually attached after the text control and associated as its description.
03
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
addon.background
color.surface-container
addon.foreground
color.on-surface-variant
addon.border-color
color.outline
addon.border-width
1px
addon.padding-x
spacing.md
addon.padding-y
spacing.sm
addon.text
typography.body-md
addon.background-disabled
color.disabled
addon.foreground-disabled
color.on-surface-variant
radius
rounded.sm
04
States
State
Source
Summary
default
platform
Enabled Text Field with one or more attached addons.
disabled
platform
Visual state inherited from the disabled Text Field.
invalid
platform
Error visual state inherited from the invalid Text Field.
05
Accessibility
From the contract's accessibility obligations. Role none
The Text Field and interactive addon children retain native keyboard behavior and document-order focus.
Text addon content is programmatically associated with the Text Field control as descriptive content.
Icon-only and button addons retain their own accessible names.
The wrapper adds no form-control role and does not duplicate Text Field semantics.