Textarea 20

PreviousNext

A read-only textarea with muted background styling for displaying non-editable content

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Read only textarea</Label>
      <Textarea
        className='read-only:bg-muted'
        defaultValue='Read only text'
        placeholder='Type your feedback here'
        id={id}
        readOnly
      />
    </div>
  )
}

export default TextareaReadOnlyDemo

Installation

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

Usage

import { Textarea20 } from "@/components/textarea-20"
<Textarea20 />