Input 32

PreviousNext

Input field with a right-aligned icon button, ideal for actions like downloading or submitting email addresses

Docs
shadcn-studiocomponent

Preview

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

import { DownloadIcon } from 'lucide-react'

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Input with icon button</Label>
      <div className='flex rounded-md shadow-xs'>
        <Input
          id={id}
          type='email'
          placeholder='Email address'
          className='-me-px rounded-r-none shadow-none focus-visible:z-1'
        />
        <Button variant='outline' size='icon' className='rounded-l-none'>
          <DownloadIcon />
          <span className='sr-only'>Download</span>
        </Button>
      </div>
    </div>
  )
}

export default InputIconButtonDemo

Installation

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

Usage

import { Input32 } from "@/components/input-32"
<Input32 />