Expanding Flex Card
A stunning, fully responsive flex-based card system. On desktop and tablet, cards expand on hover/click to reveal content. On mobile, it automatically transforms into a smooth, draggable carousel with pagination indicators.
layoutframer-motion
Installation
$npx futureuikit add expanding-card
Import
import { ExpandingFlexCard } from "@/components/ui/expanding-flex-card"
Layout Variant
Color Theme
Theme
Shape
Spacing
Named Keys & Props
Pass these exact named keys as props on <ExpandingFlexCard />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)variantVisual style"solid""outline""ghost""link"themeSurface theme"default""modern""clean""futuristic""brutal""halftone"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"Usage Example
A basic implementation example to get you started.
Example Implementation
import { ExpandingFlexCard } from"@/components/ui/expanding-flex-card";
const options = [
{ id: 1, main:"Forest", sub:"Majestic trees", img:"...", icon:"🚶"}
];
export default function Example() {
return <ExpandingFlexCard options={options} />;
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Dynamic flex-grow animations for desktop/tablet layouts.
- ◆Automatic transformation to a draggable carousel on mobile devices.
- ◆Glassmorphism content overlays with blur effects.
- ◆Customizable icons, background images, and text content.
- ◆Built-in pagination indicators for the mobile carousel view.
- ◆Smooth spring physics using Framer Motion.
Notes
Important implementation details to consider.
Implementation Details
- ◆Install: Run'npx futureuikit add expanding-card'.
- ◆Import:'import { ExpandingFlexCard } from "@/components/ui/expanding-flex-card";'
- ◆Data Structure: Provide an'options'array with'id','img'(background URL),'icon','main'(title), and'sub'(caption).
- ◆Adaptive UI: The component automatically switches between Flex (Desktop) and Carousel (Mobile) based on viewport width.
- ◆Customization: Pass custom CSS classes via the'className'prop to control card height or container width.