Gleam Box
A scroll-triggered box component with a beautiful shine effect using CSS view-timeline animations.
Installation
Usage
import { GleamBox } from "@/components/pluto-ui/gleam-box"<GleamBox>
<p>Your content here</p>
</GleamBox>Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Content to display inside the box |
className | string | - | Additional CSS classes |
as | ElementType | "div" | HTML element or React component to render (e.g., "article", "section") |
shineColor | string | - | Custom color for the shine effect (CSS color value, e.g., "hsl(280 100% 70%)" or "#ff00ff") |
shineIntensity | number | 40 | Intensity of the shine effect (0-100, where higher values make the shine more visible) |
Examples
Basic Usage
Bento Grid Layout
Create beautiful grid layouts with the gleam effect:
Custom Content
Use the as prop to render semantic HTML elements:
Features
- Scroll-triggered animations: Uses CSS
animation-timeline: view()for smooth scroll-based animations - Theme-aware: Fully supports light and dark themes using CSS variables
- Reduced motion support: Respects
prefers-reduced-motionmedia query - Browser compatibility: Graceful fallback for browsers without
animation-timelinesupport - Customizable: Use the
asprop to render any HTML element - Type-safe: Full TypeScript support
Browser Support
This component uses CSS animation-timeline: view() which is supported in:
- Chrome 115+
- Edge 115+
- Safari 17.4+
For browsers without support, the component will still render with all styling, but animations will be disabled.
Notes
- The shine effect is triggered as the component enters and exits the viewport
- The animation uses CSS
@propertyfor type-safe custom properties - All colors are theme-aware and automatically adapt to light/dark mode
- The component is fully accessible and maintains semantic HTML structure
Credits
This component was inspired by the CSS view-timeline shine effect demonstrations.
Feature Block
An interactive feature showcase component with smooth animations using motion, displaying images that change based on selected features.
iPadOS Pointer Cursor
Interactive cursor component that highlights interactive elements with smooth animations using motion, mimicking iPadOS pointer interactions.