Input 16

PreviousNext

A URL input field with "https://" text prefix positioned at the start

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Input with start text add-on</Label>
      <div className='relative'>
        <Input id={id} type='text' placeholder='shadcnstudio.com' className='peer pl-17' />
        <span className='pointer-events-none absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-sm peer-disabled:opacity-50'>
          https://
        </span>
      </div>
    </div>
  )
}

export default InputStartTextAddOnDemo

Installation

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

Usage

import { Input16 } from "@/components/input-16"
<Input16 />