Input 27

PreviousNext

A file input field with custom styling for the file picker button

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>File input</Label>
      <Input
        id={id}
        type='file'
        className='text-muted-foreground file:border-input file:text-foreground p-0 pr-3 italic file:mr-3 file:h-full file:border-0 file:border-r file:border-solid file:bg-transparent file:px-3 file:text-sm file:font-medium file:not-italic'
      />
    </div>
  )
}

export default InputFileDemo

Installation

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

Usage

import { Input27 } from "@/components/input-27"
<Input27 />