Interactive
Stars Scrolling Wheel
Animated stars scrolling wheel with number counter and completion effects. Perfect for React applications requiring achievement displays with Next.js integration and TypeScript support.
Powered by
Installation
npx shadcn@latest add https://www.shadcn.io/registry/stars-scrolling-wheel.json
npx shadcn@latest add https://www.shadcn.io/registry/stars-scrolling-wheel.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/stars-scrolling-wheel.json
bunx shadcn@latest add https://www.shadcn.io/registry/stars-scrolling-wheel.json
Features
- Animated number wheel with smooth spring physics scrolling through value ranges using Motion
- Star completion effects with fill animation, glow effects, and particle bursts using Lucide React icons
- In-view detection triggers animation when component enters viewport with configurable timing
- Customizable increments with configurable step values and side item display counts
- Gradient overlays with smooth fade effects for realistic wheel appearance
- TypeScript support with complete interface definitions for all animation and styling props
Use Cases
This free open source React component works well for:
- Achievement displays - Star ratings and milestone counters in Next.js applications
- Progress indicators - Visual feedback for completion states using TypeScript and Tailwind CSS
- Statistics dashboards - Animated counters for user metrics and performance data
- Gamification elements - Reward systems and level progression displays
API Reference
StarsScrollingWheel
Prop | Type | Default | Description |
---|---|---|---|
stars | number | required | Target number of stars to count towards |
step | number | 100 | Increment value between each displayed number |
itemHeight | number | 48 | Height of each number item in pixels |
sideItemsCount | number | 2 | Number of items visible above and below center |
transition | SpringOptions | { stiffness: 90, damping: 30 } | Motion spring configuration for scrolling animation |
inView | boolean | false | Only animate when component enters viewport |
inViewMargin | string | "0px" | Margin for in-view detection trigger |
inViewOnce | boolean | true | Only trigger in-view animation once |
delay | number | 0 | Initial delay before animation starts in milliseconds |
className | string | - | CSS classes for container styling |
Animation Sequence
- Number scrolling - Spring-animated vertical movement through value range
- Star filling - Color transition from muted to yellow when completed
- Completion effects - Radial glow, scale animation, and particle burst
- Particle animation - Six particles radiating outward in circular pattern
Visual Components
- Gradient masks - Top and bottom fade effects for realistic wheel appearance
- Center highlight - Muted background bar emphasizing current value
- Number formatting - Intl.NumberFormat for proper thousand separators
- Star icon - Lucide React Star with fill animation on completion
Implementation Notes
- Uses Motion's useTransform for smooth value interpolation
- Completion detection triggers when value reaches 99% of target
- Gradient overlays use z-index layering for proper visual hierarchy
- Number range generation accommodates side items for smooth scrolling
- Component forwards ref for advanced integration scenarios
- All animations cleanup automatically on component unmount
Spinner
Loading spinner component for React and Next.js applications. Built with TypeScript support, Tailwind CSS styling, and shadcn/ui design featuring smooth animations, multiple variants, and accessibility features.
Tabs
Animated tabs with smooth transitions and motion highlight. Perfect for React applications requiring organized content sections with Next.js integration and TypeScript support.