For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Holo Card

A card with a procedural foil that reacts to pointer tilt and device motion.

holo-card-demo.tsx
"use client";

import { FrakmentMark } from "@/components/site/brand";
import { HoloCard } from "@/components/ui/holo-card";

export function HoloCardDemo() {
  return (
    <HoloCard className="max-w-xs" logo={<FrakmentMark />} preset="bursts" />
  );
}

Holo Card renders a surface under a procedural foil layer that shifts as the pointer moves or the device tilts. The default card layout shows a chip and a brand mark; pass a HoloCardImage child (or variant="image") to render artwork instead. The foil is drawn with WebGL2.

Installation

Usage

holo-card.tsx
import { HoloCard, HoloCardImage } from "@/components/ui/holo-card";

Card mode is the default. Pass a logo to brand the bottom-right corner.

holo-card.tsx
<HoloCard logo={<MyLogo />} />

Image mode keeps the artwork-first layout. Passing a HoloCardImage child (or variant="image") switches the card into image mode.

holo-card.tsx
<HoloCard variant="image">
  <HoloCardImage alt="Pikachu" src="/card.avif" />
</HoloCard>

HoloCard owns pointer tracking, tilt, device orientation, and foil rendering. HoloCardImage is a marker component that supplies src and alt to the parent.

Anatomy

holo-card.tsx
<HoloCard logo={<MyLogo />} preset="bursts" />
  • HoloCard - root container. Owns pointer tracking, tilt, orientation, and foil rendering.
  • HoloCardImage - marker child. Switches to image mode and supplies src and alt.

Image mode

Pass a HoloCardImage child or set variant="image" to render artwork under the foil. Presets combine with both card and image modes.

Cosmos preset, light artwork

holo-card-cosmos-demo.tsx
"use client";

import { HoloCard, HoloCardImage } from "@/components/ui/holo-card";

export function HoloCardCosmosDemo() {
  return (
    <HoloCard className="max-w-xs" preset="cosmos" variant="image">
      <HoloCardImage
        alt="Holographic card"
        src="/examples/holo-card/holo-card-light-2.avif"
      />
    </HoloCard>
  );
}

Bursts preset, dark artwork

holo-card-bursts-demo.tsx
"use client";

import { HoloCard, HoloCardImage } from "@/components/ui/holo-card";

export function HoloCardBurstsDemo() {
  return (
    <HoloCard className="max-w-xs" preset="bursts" variant="image">
      <HoloCardImage
        alt="Holographic card"
        src="/examples/holo-card/holo-card-dark-2.avif"
      />
    </HoloCard>
  );
}

Presets

PresetFoil shape
burstsRadial bursts from the pointer position. Default.
cosmosLayered rings and fine dust.

API Reference

HoloCard

PropTypeDefaultDescription
variant
cardimage
—Card layout. `image` requires a HoloCardImage child or the `image` prop.
logo
stringReactNode
—Bottom-right mark. Strings starting with /, https://, or data: render as an img. Other strings render as text. Any ReactNode renders as-is.
chipReactNode—Override the built-in chip. Pass any element: lucide icon, custom SVG, or img.
preset
burstscosmos
—Foil shape.
imagestring—Artwork URL. Alternative to the HoloCardImage child.
altstring—Accessible description of the artwork.
intensitynumber—Foil opacity, 0 to 1.
tiltMaxnumber—Maximum rotation in degrees at the edge.
glarenumber—Specular highlight strength, 0 to 1.
edgeSparklenumber—Sparkle density at the card border.
framenumber—Border frame thickness in pixels.
radiusnumber—Corner radius in pixels.
widthnumber—Card width in pixels.
shadowboolean—Render a soft drop shadow.
idleboolean—Drift the light when the pointer is away.
backImagestring—Back artwork URL. When set, the card becomes flippable.
childrenReactNode—Overlay content rendered above the card.
foilColorstring—Base color of the foil.
hoverScalenumber—Scale applied when pointer hovers.
scalenumber—Foil pattern scale multiplier.
classNamestring—Merged into the root.
styleCSSProperties—Merged into the root style object.

Extends React.ComponentProps<"div">.

HoloCardImage

PropTypeDefaultDescription
src*string—Artwork URL.
alt*string—Accessible description.

Marker component. HoloCard reads src and alt from this child and switches to image mode.

Accessibility

  • Pass a meaningful alt to HoloCardImage or the alt prop on HoloCard.
  • Tilt follows the pointer on desktop and the device orientation on touch devices.
  • Motion respects prefers-reduced-motion - tilt, springs, and orientation are disabled.
  • The card is focusable only when a backImage is provided for flip interaction.

Best Practices

  • Use artwork that reads at a glance. In image mode the foil adds motion; the image carries identity.
  • Provide a logo for card mode. Without one, only the chip is visible in the bottom-right region.
  • Keep intensity between 0.6 and 0.9. High values overwhelm text layered on top.
  • Pick bursts for bright palettes, cosmos for dark palettes. Bursts read best on colorful art; cosmos reads best on deep backgrounds.