Input 15

PreviousNext

An email input field with a mail icon positioned at the end

Docs
shadcn-studiocomponent

Preview

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

import { MailIcon } from 'lucide-react'

import { Input } from '@/registry/new-york/ui/input'
import { Label } from '@/registry/new-york/ui/label'

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

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

export default InputEndIconDemo

Installation

npx shadcn@latest add @shadcn-studio/input-15

Usage

import { Input15 } from "@/components/input-15"
<Input15 />