Textarea 12

PreviousNext

A textarea with end icon positioned on the right side

Docs
shadcn-studiocomponent

Preview

Loading preview…
registry/new-york/components/textarea/textarea-12.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 TextareaEndIconDemo = () => {
  const id = useId()

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

export default TextareaEndIconDemo

Installation

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

Usage

import { Textarea12 } from "@/components/textarea-12"
<Textarea12 />