Uai

formsform-field.tsx

Color theme

component · 21/108

Form Field

Labels, descriptions, requirements, validation, and character counts.

Install

Install manuallyView source on GitHub

Anatomy

  • FormField
  • FormFieldLabel
  • FormFieldTextarea
  • FormFieldDescription
  • FormFieldError
  • FormFieldCount

Accessibility3 checks

  • Label, required state, description, error, and count are connected to the native input or textarea.
  • The root owns the string value; use one input or textarea per field. Validation remains consumer-owned.
  • Pass inputId on the root to connect external summaries. Mount optional descriptions and errors only when relevant.
canvasvariant="outlined"forms
Forms and usability

Use at least 10 characters. You can change this later.

68 / 120 characters
form field variant

Code example

usage.tsx
"use client";import { useState } from "react";import {  FormField,  FormFieldCount,  FormFieldDescription,  FormFieldError,  FormFieldLabel,  FormFieldTextarea,  type FormFieldVariant,} from "@/components/ui/uai/form-field";export function FormFieldPreview({ variant = "outlined" }: { variant?: FormFieldVariant }) {  const [value, setValue] = useState(    "Where the growth team plans launches and tracks pricing experiments.",  );  const [touched, setTouched] = useState(false);  return (    <FormField      variant={variant}      value={value}      onValueChange={setValue}      required      maxLength={120}      invalid={touched && value.trim().length < 10}    >      <FormFieldLabel>Workspace description</FormFieldLabel>      <FormFieldTextarea        name="description"        onBlur={() => setTouched(true)}        placeholder="What will your team work on?"      />      <FormFieldDescription>        Use at least 10 characters. You can change this later.      </FormFieldDescription>      <FormFieldError>Enter a description with at least 10 characters.</FormFieldError>      <FormFieldCount />    </FormField>  );}

Manual installation

form-field.tsx

Loading component source…

esc
ThinkingAI
MessageAI
CitationAI
AttachmentAI
Tool CallAI
Response StatusAI
Run SummaryAI
Conversation ThreadAI · Block
Research SessionAI · Block
File AnalysisAI · Block
Agent RunAI · Block
Approval CardFeedback
Empty StateFeedback
Status BannerFeedback
Progress SummaryFeedback
Inline FeedbackFeedback
Confirmation DialogFeedback
Activity TimelineFeedback
Skeleton GroupFeedback
Prompt ComposerForms
Form FieldForms
Search FieldForms
Filter BarForms
File UploadForms
Date Range PickerForms
Form Error SummaryForms
Unsaved Changes BarForms
Step IndicatorForms
Task ListData Display
Data Table ToolbarData Display
Metric CardData Display
Description ListData Display
Comparison TableData Display
Kanban BoardData Display
Calendar ViewData Display
Audit LogData Display
App HeaderNavigation
App SidebarNavigation
Breadcrumb TrailNavigation
Page TabsNavigation
Command MenuNavigation
Split PaneNavigation
Sign-in CardAuthentication
Sign-up CardAuthentication
Password RecoveryAuthentication
Code VerificationAuthentication · Block
Onboarding WizardAuthentication · Block
Workspace SetupAuthentication · Block
Coupon FieldCommerce
Quantity PickerCommerce
Cart ItemCommerce
Price SummaryCommerce
Order StatusCommerce
Product DetailCommerce · Block
Product ListingCommerce · Block
Cart DrawerCommerce · Block
CheckoutCommerce · Block
Order TrackingCommerce · Block
Subscription ManagementCommerce · Block
Announcement BarMarketing
Pricing ToggleMarketing
Testimonial CardMarketing
Product GalleryMarketing
Trust PanelMarketing
Newsletter FormMarketing
Hero SectionMarketing · Block
Feature ShowcaseMarketing · Block
Pricing SectionMarketing · Block
Testimonials SectionMarketing · Block
FAQ SectionMarketing · Block
Call to ActionMarketing · Block
Waitlist SectionMarketing · Block
Contact SectionMarketing · Block
Author CardContent
CommentContent
Reaction BarContent
Share MenuContent
Changelog EntryContent
Article PageContent · Block
Documentation PageContent · Block
Changelog PageContent · Block
Comment ThreadContent · Block
Community FeedContent · Block
Public ProfileContent · Block
Map FrameMaps
Map ControlsMaps
Map MarkerMaps
Map LegendMaps
Place CardMaps
Route SummaryMaps
Dashboard ShellApplication · Block
Settings PageApplication · Block
Profile PageApplication · Block
Team ManagementApplication · Block
Notification CenterApplication · Block
Billing PortalApplication · Block
Search ResultsApplication · Block
Resource ManagerOperations · Block
Data ExplorerOperations · Block
Import WorkflowOperations · Block
Approval QueueOperations · Block
Audit Log ViewerOperations · Block
Incident DashboardOperations · Block
Report BuilderOperations · Block
Document FieldBrazil
CEP FieldBrazil
Pix PaymentBrazil
Installment PickerBrazil