Textarea 2

PreviousNext

A textarea with associated label for improved accessibility

Docs
shadcn-studiocomponent

Preview

Loading preview…
registry/new-york/components/textarea/textarea-02.tsx
import { useId } from 'react'

import { Label } from '@/registry/new-york/ui/label'
import { Textarea } from '@/registry/new-york/ui/textarea'

const TextareaWithLabelDemo = () => {
  const id = useId()

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Textarea with label</Label>
      <Textarea placeholder='Type your feedback here' id={id} />
    </div>
  )
}

export default TextareaWithLabelDemo

Installation

npx shadcn@latest add @shadcn-studio/textarea-02

Usage

import { Textarea02 } from "@/components/textarea-02"
<Textarea02 />