Input 20

PreviousNext

A domain input field with an external ".com" add-on box at the end

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Input with end add-on</Label>
      <div className='flex rounded-md shadow-xs'>
        <Input id={id} type='text' placeholder='shadcnstudio' className='-me-px rounded-r-none shadow-none' />
        <span className='border-input bg-background text-muted-foreground -z-1 inline-flex items-center rounded-r-md border px-3 text-sm'>
          .com
        </span>
      </div>
    </div>
  )
}

export default InputEndAddOnDemo

Installation

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

Usage

import { Input20 } from "@/components/input-20"
<Input20 />