Weftv0.4.0
GitHubFigma
Blade AI
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

#preview

Switch size, validation and state. The React and CSS tabs update with the preview.

Lowercase letters, numbers and hyphens. Shown in your workspace URL.

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-states

Every state from the Text input states table, named and shown at size medium.

Text input · 12 states · size medium
Default
Hover
Focus
Active
Filled
Clearable
With icons
Loading
Success
Error
Disabled
Read-only