Input 11

PreviousNext

An email input field with hint text indicating the field is optional

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <div className='flex items-center justify-between gap-1'>
        <Label htmlFor={id}>Input with hint text</Label>
        <span className='text-muted-foreground text-xs'>Optional field</span>
      </div>
      <Input id={id} type='email' placeholder='Email address' />
    </div>
  )
}

export default InputHintTextDemo

Installation

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

Usage

import { Input11 } from "@/components/input-11"
<Input11 />