Textarea 17

PreviousNext

An auto-growing textarea with field-sizing-content that expands with text content

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Auto growing textarea</Label>
      <Textarea
        id={id}
        placeholder='Type your feedback here'
        className='field-sizing-content max-h-30 min-h-0 resize-none py-1.75'
      />
    </div>
  )
}

export default TextareaAutoGrowDemo

Installation

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

Usage

import { Textarea17 } from "@/components/textarea-17"
<Textarea17 />