Lens Search

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/input-lens

About this component

Search that starts as a magnifying glass. Focusing it stretches the glass's ring sideways into the field itself while the handle tucks away and a small lens settles inside; empty it and click away and it shrinks back into the glass. Pure CSS.

Triggers

  • Focus
  • Morph
  • Icon

Techniques

  • CSS transition
  • Pseudo elements
  • border-radius

Difficulty

Beginner

Accessibility

Keyboard and screen readers

A real search input inside role="search", labelled "Search components"; it expands on focus, so keyboard users see it open as they tab in.

Reduced motion

It opens and closes instantly.

Use it in anything you build, commercial and client work included. Licence

More inputs

See all
Guests
Drag the number to scrub
OdometerGet code
PeekGet code
AuroraGet code