Expandable Card
Mathematical FLIP morphing card dialog with zero Framer Motion dependencies, zero layout shifts, and accessible dialog semantics.
Interactive Specification & Studio
FLIP Morphing Architecture
Mathematical geometry snapshot with zero Framer Motion.
Quick Start & Consumer Example
Copy-paste ready implementation for React (.tsx). Automatically updates when you modify parameters in the Workbench above.
import React from 'react';
import { ExpandableCard } from '@/components/ui/ExpandableCard';
export default function ExpandableDemo() {
return (
<div className="flex min-h-screen items-center justify-center p-8 bg-background">
<div className="w-full max-w-sm">
<ExpandableCard
duration={360}
cardContent={
<div className="rounded-2xl border border-border bg-card p-6 shadow-lg transition-all hover:border-primary/50">
<span className="font-mono text-xs font-bold text-primary">CLICK TO EXPAND</span>
<h4 className="mt-2 text-lg font-bold text-foreground">FLIP Morphing Card</h4>
<p className="mt-1 text-xs text-muted-foreground leading-relaxed">
Hardware-accelerated layout morphing with zero Framer Motion dependencies.
</p>
</div>
}
expandedContent={
<div className="space-y-4">
<span className="font-mono text-xs font-bold text-primary">EXPANDED MODAL DIALOG</span>
<h3 className="text-2xl font-black text-foreground">Analytical FLIP Kinetics</h3>
<p className="text-sm text-muted-foreground leading-relaxed">
The card measures its initial trigger geometry and smoothly morphs into a centered dialog before reversing seamlessly upon dismissal.
</p>
<div className="rounded-xl border border-border bg-muted/30 p-4 font-mono text-xs text-muted-foreground">
Press ESC or click the backdrop to close
</div>
</div>
}
/>
</div>
</div>
);
}
Props & Configuration
Exhaustive parameter contract for Expandable Card. Validated in the live Studio workbench above and statically checked across all 13 ecosystem templates.
| Prop | Type | Default | Description |
|---|---|---|---|
duration | number | 360 | FLIP transition timing in milliseconds. |
FLIP transition timing in milliseconds.
Component Source
Component source definition for React (.tsx). Toggle between the clean wrapper and the standalone ejected engine micro-kernel.
import * as React from 'react';
import * as ExpandableCardPrimitive from '@exhuma/core';
import { clsx } from 'clsx';
export interface ExpandableCardProps extends React.ComponentPropsWithoutRef<typeof ExpandableCardPrimitive.ExpandableCard> {
className?: string;
}
export const ExpandableCard = React.forwardRef<HTMLDivElement, ExpandableCardProps>(
({ className, children, ...props }, ref) => (
<ExpandableCardPrimitive.ExpandableCard
ref={ref}
className={clsx(
'relative overflow-hidden rounded-2xl border border-border bg-card p-6 shadow-sm transition-shadow hover:shadow-md cursor-pointer',
className
)}
{...props}
>
{children}
</ExpandableCardPrimitive.ExpandableCard>
)
);
ExpandableCard.displayName = 'ExpandableCard';
export const ExpandableRoot = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, children, ...props }, ref) => (
<ExpandableCardPrimitive.Root
ref={ref}
className={clsx('', className)}
{...props}
>
{children}
</ExpandableCardPrimitive.Root>
)
);
ExpandableRoot.displayName = 'ExpandableRoot';
export const ExpandableTrigger = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, children, ...props }, ref) => (
<ExpandableCardPrimitive.Trigger
ref={ref}
className={clsx('', className)}
{...props}
>
{children}
</ExpandableCardPrimitive.Trigger>
)
);
ExpandableTrigger.displayName = 'ExpandableTrigger';
export const ExpandableContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, children, ...props }, ref) => (
<ExpandableCardPrimitive.Content
ref={ref}
className={clsx('', className)}
{...props}
>
{children}
</ExpandableCardPrimitive.Content>
)
);
ExpandableContent.displayName = 'ExpandableContent';
export const ExpandableClose = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, children, ...props }, ref) => (
<ExpandableCardPrimitive.Close
ref={ref}
className={clsx('', className)}
{...props}
>
{children}
</ExpandableCardPrimitive.Close>
)
);
ExpandableClose.displayName = 'ExpandableClose';
Lifecycle Safety & Performance
Engineered for high-frequency user interactions with zero memory leaks.
Deterministic Cleanup
GPU Compositor Acceleration
will-change: transform without triggering browser layout recalculations.Accessibility Considerations
Fully compliant with WCAG guidelines and respects user motion preferences.
prefers-reduced-motion Support
prefers-reduced-motion: reduce enabled in their operating system, Exhuma components automatically disable 3D gyroscope tilt and spring animations, rendering static accessible content.