Components
Text Field

Text Field

A text field component for use inside a form

Last Name can not be Alcorn!

About

The TextField is built using a composition of the <Input />, <FieldLabel />, <FieldError /> and the <FieldContainer /> components.

Usage

'use client';
 
import * as React from 'react';
 
import { TextField } from '@/components/ui/formfield';
 
export function TextFieldDemo() {
  return (
    <form>
      <TextField name="first" label="First Name" defaultValue="Tom" required={true} readOnly={true} />
      <TextField name="last" label="Last Name" defaultValue="Alcorn" error="Last Name can not be Alcorn!" />
    </form>
  );
}
'use client';
 
import * as React from 'react';
 
import { TextField } from '@/components/ui/formfield';
 
export function TextFieldDemo() {
  return (
    <form>
      <TextField name="first" label="First Name" defaultValue="Tom" required={true} readOnly={true} />
      <TextField name="last" label="Last Name" defaultValue="Alcorn" error="Last Name can not be Alcorn!" />
    </form>
  );
}