Capítulo 5 de 11

Chapter 5: Buttons & Inputs

Core Idea

Interactive controls with built-in animation — buttons that react to hover/click state, and form inputs with motion-driven feedback.

Reference Table

NamePurposeInstall
Hover Border GradientHover effect that grows a gradient border across the whole containernpx shadcn@latest add @aceternity/hover-border-gradient
Magnetic ButtonButton that subtly drifts toward the cursor, springs back on leavenpx shadcn@latest add @aceternity/magnetic-button
Moving BorderBorder that continuously travels around the containernpx shadcn@latest add @aceternity/moving-border
Stateful ButtonButton with built-in loading → success state transitionnpx shadcn@latest add @aceternity/stateful-button
File UploadDrag-and-drop upload with background grid and micro-interactionsnpx shadcn@latest add @aceternity/file-upload
Floating DockmacOS-style floating dock, doubles as a nav barnpx shadcn@latest add @aceternity/floating-dock
Gooey InputSearch-style input that expands with a gooey SVG filternpx shadcn@latest add @aceternity/gooey-input
Placeholders And Vanish InputInput with cycling placeholder text and a vanish effect on submitnpx shadcn@latest add @aceternity/placeholders-and-vanish-input
Signup FormSignup form built on shadcn's input/label, with Motion touchesnpx shadcn@latest add @aceternity/signup-form

Key Takeaways

  1. Stateful Button owns its own loading/success state internally — don't wrap it in a separate loading spinner, wire your submit handler's promise to its API instead.
  2. Signup Form assumes shadcn/ui's input/label primitives are already installed — install those first if starting from a bare project.
  3. Moving Border and Hover Border Gradient both animate a border but differ in trigger: Moving Border loops continuously, Hover Border Gradient is hover-triggered.

Connects To

  • ch001 (Setup & Utilities): the cn helper these all depend on.
  • shadcn-ui-docs (separate skill): the input/label/form primitives some of these build on.