tuil
ReferenceComponentsForms and controls

Forms and controls

Connect semantic terminal controls to typed form state, validation, descriptions, errors, hints, and submission.

View rawEdit

Overview

Connect semantic terminal controls to typed form state, validation, descriptions, errors, hints, and submission.

Installation

npx @mwillbanks/tuil add field text-input text-area number-input checkbox switch radio-group select multi-select autocomplete password-input search-input command-line code-editor inline-editor editable-table-cell editable-tree-node form-field-editor date-time-input

The CLI writes source-owned components beneath the destination configured in tuil.config.ts; the default import below assumes src/components/tuil.

Loading executable example…

Components and subcomponents

APISignatureDescription
Formfunction FormPublic function Form.
ValidationSummaryfunction ValidationSummaryPublic function ValidationSummary.
Fieldfunction FieldPublic function Field.
FieldLabelconstant FieldLabelPublic constant FieldLabel.
FieldDescriptionconstant FieldDescriptionPublic constant FieldDescription.
FieldErrorconstant FieldErrorPublic constant FieldError.
FieldHintconstant FieldHintPublic constant FieldHint.
FieldGroupconstant FieldGroupPublic constant FieldGroup.
FieldSetconstant FieldSetPublic constant FieldSet.
TextInputfunction TextInputPublic function TextInput.
TextAreafunction TextAreaPublic function TextArea.
NumberInputfunction NumberInputPublic function NumberInput.
Checkboxfunction CheckboxPublic function Checkbox.
Switchfunction SwitchPublic function Switch.
RadioGroupfunction RadioGroupPublic function RadioGroup.
Selectfunction SelectPublic function Select.
MultiSelectfunction MultiSelectPublic function MultiSelect.
Autocompletefunction AutocompletePublic function Autocomplete.
PasswordInputfunction PasswordInputPublic function PasswordInput.
SearchInputfunction SearchInputPublic function SearchInput.
CommandLinefunction CommandLinePublic function CommandLine.
CodeEditorfunction CodeEditorPublic function CodeEditor.
InlineEditorconstant InlineEditorPublic constant InlineEditor.
EditableTableCellconstant EditableTableCellPublic constant EditableTableCell.
EditableTreeNodeconstant EditableTreeNodePublic constant EditableTreeNode.
FormFieldEditorconstant FormFieldEditorPublic constant FormFieldEditor.
DateTimeInputfunction DateTimeInputPublic function DateTimeInput.

Interaction

Text controls edit directly; choice controls use arrows and Space or Enter; Form coordinates validation and submission.

API and events

Controls expose onValueChange, onSubmit, focus, selection, and validation callbacks.

Every interactive component publishes semantic roles, labels, state, and focus identity through the renderer's SemanticRegistry. Callback failures flow to the owning application's error boundary.

Documentation flow diagram. props and runtime state; semantic registration; focus and input routing; callback or state update; rerender; S0 leads to S1; S1 leads to S2; S2 leads to S3
Documentation flow diagram. props and runtime state; semantic registration; focus and input routing; callback or state update; rerender; S0 leads to S1; S1 leads to S2; S2 leads to S3

Example

import type { ComponentProps } from "react";
import { Form } from "@/components/tuil/forms/controls";

export function Example(props: ComponentProps<typeof Form>) {
  return <Form {...props} />;
}

Registry-installed components are source-owned: customize the generated file in your application, and use the package reference for the shared runtime contracts.

On this page