Inputs · TextInputstable
Text input
A single-line field with a visible label, help text and validation. Three sizes, optional icons, prefix or suffix, and a clear button; square, flat and token-driven.
Preview
#previewSwitch size, validation and state. The React and CSS tabs update with the preview.
size medium · leadingIcon · suffix=".blade.ai" · helpText
workspace-form.tsx
import { TextInput } from "@blade-ai/weft/components/text-input";
import { WorkspaceIcon } from "@blade-ai/weft/components/icons";
export function WorkspaceNameField({ value, error, onChange, onBlur }: Props) {
return (
<TextInput
label="Workspace name"
placeholder="e.g. blade-research"
value={value}
onChange={onChange}
onBlur={onBlur} // validate on blur, not per keystroke
size="medium"
leadingIcon={WorkspaceIcon}
suffix=".blade.ai"
autoComplete="off"
isRequired
validationState={error ? "error" : "none"}
helpText="Lowercase letters, numbers and hyphens."
errorText={error}
/>
);
}All states
#all-statesEvery state from the Text input states table, named and shown at size medium.
Default
Hover
Focus
Active
Filled
Clearable
With icons
Loading
Success
Error
Disabled
Read-only