Octagon

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-octagon

About this component

An 8-sided button shaped with a CSS clip-path polygon. On hover, the entire shape rotates 22.5 degrees with a spring overshoot, the background gradient fills in, and the inner text counter-rotates to stay upright.

Triggers

  • Hover

Techniques

  • clip-path
  • CSS transition

Difficulty

Beginner

Moves on

Its code uses this curve. Open one to see it plotted and tune it.

Accessibility

Reduced motion

Rotation transition should be disabled under prefers-reduced-motion.

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

More buttons

See all
Orbit ParticlesGet code
Retro PixelGet code