Velora UI

Vanish Input

Search field whose placeholder cycles while empty.

  • 1.6 KB gzipped
  • Deps: motion/react
  • Reduced-motion safe
  • Base UI & Radix compatible
Open in v0

Preview

Installation

pnpm dlx shadcn@latest add https://velora.colorlib.com/r/vanish-input.json

Adds components/velora/vanish-input.tsx, installs motion.

Props

PropTypeDefault
placeholders*

Cycled through while the field is empty

string[]—
interval

Seconds each placeholder is held

number3
label

Accessible name for the input

string"Search"
onSubmit(value: string) => void—
classNamestring—

Accessibility

Reduced motion
The placeholder does not cycle: it stays on the first entry, with no slide or fade.
Keyboard
A native form: the input is focusable, Enter submits, and focus stays in the input after submitting. The placeholder stops cycling while the field is hovered or focused.
Screen readers
The input is named by the `label` prop (default "Search"); the rotating placeholder is aria-hidden and the icon button is named "Submit".