Text Field Controlled

PreviousNext

text-field-controlled-demo

Docs
intentuipage

Preview

Loading preview…
components/docs/forms/text-field/text-field-controlled-demo.tsx
"use client"

import { useState } from "react"

import { Description, Label } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { TextField } from "@/components/ui/text-field"

export default function TextFieldControlledDemo() {
  const [value, setValue] = useState("")
  return (
    <div className="fle flex-col">
      <TextField value={value} onChange={setValue}>
        <Label>Name</Label>
        <Input />
        <Description>
          You have typed: <strong>{value ?? "-"}</strong>
        </Description>
      </TextField>
    </div>
  )
}

Installation

npx shadcn@latest add @intentui/text-field-controlled-demo

Usage

Usage varies by registry entry. Refer to the registry docs or source files below for details.