Input 33

PreviousNext

An email input field with an external subscribe button connected via styling

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Input with end button</Label>
      <div className='flex rounded-md shadow-xs'>
        <Input
          id={id}
          type='email'
          placeholder='Email address'
          className='-me-px rounded-r-none shadow-none focus-visible:z-1'
        />
        <Button className='rounded-l-none'>Subscribe</Button>
      </div>
    </div>
  )
}

export default InputEndButtonDemo

Installation

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

Usage

import { Input33 } from "@/components/input-33"
<Input33 />