Strips
Vertical Strips
An interactive vertical image strips component with smooth spring animations
Loading...
pnpm dlx @sikka/naseem add strips-verticalnpx @sikka/naseem add strips-verticalyarn dlx @sikka/naseem add strips-verticalbunx --bun @sikka/naseem add strips-verticalUsage
The Vertical Strips component displays a row of image strips that expand vertically when clicked. It creates an engaging gallery experience with smooth spring animations.
import VerticalImageStrips from "@/components/elements/strips-vertical"
export default function Example() {
return <VerticalImageStrips />
}Features
- Smooth spring animations powered by Motion
- Responsive design (adapts to mobile and desktop)
- Click to expand/collapse strips
- Image scale animation on expand
- Dark overlay with gradient
- Label reveal with blur animation
- Index counter display
- Custom DM Mono typography
- Configurable gaps between strips
Implementation
The component uses:
motionfrom Motion for smooth spring animationsuseStateanduseEffectfor state management and responsive behavior- CSS-in-JS for dynamic styling
- Google Fonts (DM Mono) for typography
Code Structure
"use client";
import { motion } from "motion/react";
import { useState, useEffect } from "react";
const images = [
{
url: "https://example.com/image.jpg",
label: "Image Label",
},
// Add more images...
];
export default function VerticalImageStrips() {
const [open, setOpen] = useState<null | number>(null);
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
// Responsive dimension handling
// Render motion strips...
}Props
The Vertical Strips component is self-contained and manages its own state internally. It doesn't accept any props as the content is defined within the component.
Customization
To customize the images, modify the images array at the top of the component file:
const images = [
{
url: "https://your-image-url.jpg",
label: "Your Label",
},
// Add more images...
];Configuration Values
The component uses responsive configuration values:
| Property | Mobile | Desktop |
|---|---|---|
| Strip Width | 40px | 60px |
| Container Size | 360px | 420px |
| Outer Radius | 20px | 40px |
| Gap Between Strips | 4px | 10px |
| Radius Between Strips | 20px | 40px |
Dependencies
{
"motion": "latest"
}Styling
The component uses inline styles for dynamic values and includes:
- Spring animations with bounce and stiffness
- Gradient overlays for text readability
- Blur transitions for label reveals
- Scale animations for images
- Configurable border radius between strips