Input Affix

A text input with leading and trailing slots for icons, units or buttons, sharing one focus ring and invalid state across the field. Tailwind styled.

src/registry/ui/input-affix.tsx/r/input-affix.json

Installation#

bash
npx shadcn@latest add @minidev/input-affix

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/input-affix.json

Usage#

tsx
import { InputAffix } from "@/components/ui/input-affix"

export function Example() {
  return (
    <InputAffix id="af-search" leading={<SearchIcon />} placeholder="Search" />
  )
}

API reference#

InputAffix props
PropTypeDefault
leadingReact.ReactNode-
trailingReact.ReactNode-
containerClassNamestring-

Dependencies#

npm

React only

Built from

Examples#

All form components