Skip to content

feat: add animated Input component#81

Merged
starc007 merged 1 commit into
mainfrom
feat/animated-input
Jun 29, 2026
Merged

feat: add animated Input component#81
starc007 merged 1 commit into
mainfrom
feat/animated-input

Conversation

@starc007

Copy link
Copy Markdown
Owner

What

New Input primitive (slug input, motion category) with motion feedback, shadcn-compatible.

Features

  • Label above the field (when provided)
  • Left / right icon slots (leftIcon / rightIcon); padding shifts to fit, right icon can be interactive (e.g. password toggle)
  • Gliding caret — a custom caret measures text width via a hidden mirror and springs to the caret position, tracking the input's scrollLeft so it stays aligned when the value overflows. Password fields use the native caret (masked dots can't be measured).
  • Error — shake + destructive border/ring + blur-slide message via AnimatePresence
  • Success — SVG check draw (border unchanged)
  • Controlled + uncontrolled (value / defaultValue / onChange)
  • Reduced-motion gated throughout (drops shake/glide, keeps color/opacity)
  • Fully-rounded pill, transparent background, destructive / --color-success tokens

Files

  • components/motion/input.tsx
  • components/previews/motion/input.preview.tsx (email + error, password toggle, search + success)
  • registered in previews/index.tsx + lib/registry.ts (with SEO keywords)

Verification

  • bun run check green; registry validates 36 components

Text input with motion feedback, shadcn-compatible.

- Label above the field, optional left/right icon slots
- Gliding custom caret that measures text width and tracks the input's
  horizontal scroll; native caret for password fields
- Error shake plus destructive border and a blur-slide message
- Success check draw, reduced-motion gated throughout
@starc007 starc007 merged commit 9cb0c1f into main Jun 29, 2026
2 checks passed
@starc007 starc007 deleted the feat/animated-input branch June 29, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant