Free & open source, built for every frontend stack. Star Exhuma on GitHub
ExhumaBeta
DocsComponentsBlog

Getting Started

  • Introduction
  • Installation
  • Theming & Dark Mode
  • CLI Reference

Architecture

  • Kinetic Methodology
  • Ecosystem Contracts
  • Lifecycle & Memory Safety

Components

  • All Components20
Cards8
  • Stacking Cards
  • Horizontal Scroller
  • Tilt Card
  • Spotlight Card
  • Border Beam
  • Card Swipe Stack
  • Comparison Slider
  • Expandable Card
Layouts6
  • CSS Masonry
  • Row Masonry
  • Auto Grid
  • Infinite Marquee
  • Bento Grid
  • Diamond Grid
Navigation2
  • Morphing Tabs
  • Floating Dock
Primitives4
  • Accordion
  • Number Ticker
  • Magnetic Button
  • Cursor Tooltip
// DOCS·Components·Cards

Expandable Card

Mathematical FLIP morphing card dialog with zero Framer Motion dependencies, zero layout shifts, and accessible dialog semantics.

Target Environment
+
+
CLI Installation
React
$pnpm dlxexhumaaddexpandable-card--flavor=react
// 01·Workbench

Interactive Specification & Studio

cards
Preset:
Viewport
Fluid 100%
CLICK TO EXPAND

FLIP Morphing Architecture

Mathematical geometry snapshot with zero Framer Motion.

Parameters
1 Props
// 02·Usage

Quick Start & Consumer Example

Copy-paste ready implementation for React (.tsx). Automatically updates when you modify parameters in the Workbench above.

+
+
ExpandableDemo.tsx
React (.tsx)
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>
  );
}
// 03·API Contract

Props & Configuration

Exhaustive parameter contract for Expandable Card. Validated in the live Studio workbench above and statically checked across all 13 ecosystem templates.

PropTypeDefaultDescription
duration
number360FLIP transition timing in milliseconds.
duration
number

FLIP transition timing in milliseconds.

Default:360
// 04·Source Code

Component Source

Component source definition for React (.tsx). Toggle between the clean wrapper and the standalone ejected engine micro-kernel.

+
+
ExpandableCard.tsx
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';
// 05·Architecture

Lifecycle Safety & Performance

Engineered for high-frequency user interactions with zero memory leaks.

Teardown

Deterministic Cleanup

All pointer event listeners, scroll handlers, and resize observers are cleanly destroyed on component unmount, preventing lingering background processes.
Compositor

GPU Compositor Acceleration

Transform and opacity modifications run directly on the GPU compositor thread using will-change: transform without triggering browser layout recalculations.
// 06·a11y

Accessibility Considerations

Fully compliant with WCAG guidelines and respects user motion preferences.

Motion

prefers-reduced-motion Support

When a user has prefers-reduced-motion: reduce enabled in their operating system, Exhuma components automatically disable 3D gyroscope tilt and spring animations, rendering static accessible content.
Comparison SliderCSS Masonry