Input 5

PreviousNext

A read-only email input field with default value and muted styling

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Read-only input</Label>
      <Input
        id={id}
        type='email'
        placeholder='Email address'
        defaultValue='example@xyz.com'
        className='read-only:bg-muted'
        readOnly
      />
    </div>
  )
}

export default InputReadOnlyDemo

Installation

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

Usage

import { Input05 } from "@/components/input-05"
<Input05 />