Textarea 11

PreviousNext

A textarea with start icon positioned on the left side

Docs
shadcn-studiocomponent

Preview

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

import { HomeIcon } from 'lucide-react'

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Textarea with start icon</Label>
      <div className='relative'>
        <div className='text-muted-foreground pointer-events-none absolute top-2.5 left-0 flex items-center justify-center pl-3 peer-disabled:opacity-50'>
          <HomeIcon className='size-4' />
          <span className='sr-only'>Address</span>
        </div>
        <Textarea id={id} placeholder='Address' className='peer pl-9' />
      </div>
    </div>
  )
}

export default TextareaStartIconDemo

Installation

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

Usage

import { Textarea11 } from "@/components/textarea-11"
<Textarea11 />