Components/Card spread

Card spread

Nine content-driven card layouts and focus-blur links with selection, adjustable stamp geometry and keyboard operation.

Since 0.6.3BETA

This component doc is in progress

This page is still being migrated. Demos and API details may change.

Overview

TxCardSpread renders caller-owned items. Each layout keeps its own source coordinates, stacking order and pivot. Hover and keyboard focus expand an uncontrolled deck; the toggle pins it open. v-model:expanded controls the layout directly. v-model is the zero-based selected item, independent of expansion.

Usage

All source layouts

Loading demo...

The demo displays all nine spreads plus focus-blur, filters by the original IDs and exposes real stamp arc/gap/offset sliders. Its images are original inline SVG illustrations, not upstream assets.

VariantGeometry and source defaults
card-arc-5Bottom-center pivot; angle 30°, gap 70px, vertical stops [10,-2,-10,-2,10].
card-arc-7Seven distinct arc stops; angle 45°, gap 110px, offset 30px.
card-long-arc-5Wider, flatter arc; angle 15°, gap 140px, offset 20px.
card-linear-spreadHorizontal translation only; gap 90px.
card-corner-fanBottom-left pivot; asymmetric rotation from −10° to +30° by default.
card-stamp-arcDashed stamp edges; angle stops [-1,-0.48,0,0.48,1], gap 180px, offset 40px.
card-cascade-staggerCenter pivot; each step moves 14px right, 28px up and rotates 6°. Collapsed pages retain their 2px stagger.
card-scatter-spreadIndependent dealt-card coordinates and rotations; no symmetric fan substitution.
card-wheel-fanPivot below the cards at 110%; rotations ±36° and vertical stops [-8,-22,-28,-22,-8].
focus-blurExtra FocusBlur behavior: hovered/focused labels remain clear, siblings blur/fade and dashed brackets spring into view.

Five- and seven-stop layouts interpolate their source stops for other item counts. No cards are fabricated when items are missing.

Best Practices

  • Supply stable id values and image alternative text. title also names the selection control.
  • Use expanded when expansion is application state; leave it undefined for hover/focus and the pin toggle.
  • angle, gap and yOffset are the stamp source's arc, spread and offset controls. Other variants retain their own defaults when these props are omitted.
  • Item slots live inside selection buttons: use non-interactive content. focus-blur uses a real anchor when an item has href.
  • Keep wide layouts horizontally scrollable on small screens. size scales the cards and their geometry together.

API Reference

Props

PropTypeDefaultDescription
itemsMotionCardItem[]requiredCaller-owned content; an empty array renders only #empty.
modelValuenumberinternal 0Zero-based selected item.
variantCardSpreadVariantcard-arc-5One of the ten IDs above; exported as CARD_SPREAD_VARIANTS.
expandedbooleanundefinedControlled expansion; undefined enables hover/focus/pinning.
anglenumberper variantSource rotation in degrees.
gapnumberper variantHorizontal spread distance in pixels.
yOffsetnumberper variantSource vertical offsets in pixels.
hoverIntensitynumber1Multiplier for translation and rotation, not card scale.
durationnumber500Transition duration in milliseconds; timing uses the shared spring.
colorfulbooleanfalseToken-based card tints unless the item supplies color.
blurAmountnumber4focus-blur sibling blur in pixels.
opacityAmountnumber0.4focus-blur sibling opacity.
showBracketsbooleantrueShow focus brackets in focus-blur.
animatedbooleantrueMotion only; selection and expansion still work when false.
disabledbooleanfalseDisable selection, link navigation and the pin toggle.
sizexs / sm / md / lgmdCard and geometry scale.
ariaLabelstringCard spreadGroup accessible name.
expandLabelstringExpand cardsLocalizable toggle label.
collapseLabelstringCollapse cardsLocalizable pinned/controlled toggle label.

MotionCardItem fields are id?: string | number, title?, description?, src?, alt?, date?, href?, and color?: string. Images and text are rendered from the caller's data. color accepts a CSS color or token expression.

Events

EventArgumentsMeaning
update:modelValueindex: numberSelection from card, link or keyboard.
update:expandedexpanded: booleanPin toggle or Escape request.
selectitem: MotionCardItem, index: numberSelected caller-owned item.

Slots and instance methods

APIContract
#item{ item, index, selected, expanded }; replaces content, not card geometry.
#emptyEmpty-state content when items.length === 0.
select(index)Select an existing item unless disabled.
toggle()Toggle pin/controlled expansion unless disabled.

Left/Right, Home and End select items; native buttons support Enter/Space. Escape releases the pin and emits a controlled collapse request. Focus expands the deck and remains visibly outlined.

Technologies

Ported from Amicro CardArc5, CardArc7, CardLongArc5, CardLinearSpread, CardCornerFan, CardStampArc, CardCascadeStagger, CardScatterSpread, CardWheelFan and FocusBlur at commit 43c29ce9cdd16459e3eab4992381b8d35b38776a, under MIT, Copyright (c) 2026 SYED SUBHAN UDDIN.

Transforms use the existing shared spring compiler. useMotionActivity removes motion offscreen, in hidden documents, during KeepAlive deactivation and for reduced motion; content and operations remain available. No React/Motion runtime or external demo assets are included.