Components/FlipOverlay
Since 1.0.0BETA

FlipOverlay

3D flip overlay that expands from a trigger

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

FlipOverlay

A 3D flip overlay that expands from a trigger element, ideal for detail views, previews, and transitions.

Basic Usage

Demo loads on client.

Design Notes

  • source defines the animation origin; pass an HTMLElement or DOMRect.
  • Use rotateX / rotateY with perspective to control the 3D feel.
  • Header render priority:
    1. #header fully overrides the built-in header.
    2. Without #header, set header=false to hide header.
    3. Without #header and with header=true, built-in header can be customized by #header-display / #header-actions / #header-close.
  • closable=false hides the entire close area (including #header-close).
  • The card uses a built-in surface background layer (TxBaseSurface) by default; tune it with surface / surfaceColor / surfaceOpacity.
  • globalMask controls the full-screen visual mask layer and is enabled by default.
  • Use border to switch card border style (solid / dashed / none, and dash works as an alias of dashed).
  • randomTilt adds subtle variation to each open.
  • Set maskClosable=false to disable closing on mask click.
  • When multiple overlays are open, backdrop rendering is unified into a single shared global mask layer positioned below all overlay cards; only the top overlay keeps the interactive click layer, and underlays remain non-interactive without covering lower card edges.
  • Stack displacement is enabled automatically only when adjacent overlays have similar size (|delta| <= max(8px, previousSize * 5%) for both width and height).
  • Layered displacement is capped at depth 3 (-18/-36/-54px with 0.95/0.90/0.85 scale), and deeper layers progressively fade (1.00 → 0.92 → 0.78 → 0.62 → 0.38 → 0.16 → 0).
  • Set preventAccidentalClose=true to enable safety mode: mask click is blocked, page-exit attempts (refresh/close) are intercepted, and blocked attempts flash a red warning glow around the card.
  • Coordinate UI changes with open/opened/close/closed events.

API

Props

NameTypeDefaultDescription
modelValuebooleanfalseVisible state (v-model)
sourceHTMLElement | DOMRect | nullnullAnimation origin
sourceRadiusstring | nullnullOrigin border radius
durationnumber480Animation duration (ms)
perspectivenumber12003D perspective
rotateXnumber6X-axis rotation
rotateYnumber8Y-axis rotation
randomTiltbooleantrueRandom tilt per open
tiltRangenumber2Random tilt range
easeOutstring'back.out(1.25)'Open easing
easeInstring'back.in(1)'Close easing
maskClosablebooleantrueClick mask to close
preventAccidentalClosebooleanfalseAccidental-close protection (block mask close + intercept page exit + red warning glow)
globalMaskbooleantrueWhether to render the global visual mask layer
surface'pure' | 'mask' | 'blur' | 'glass' | 'refraction''refraction'Built-in card surface mode
surfaceColorstring''Surface base color (theme overlay color by default)
surfaceOpacitynumber0.96Surface opacity (mask mode)
headerbooleantrueEnable built-in header when no #header slot is provided
headerTitlestring''Built-in header title
headerDescstring''Built-in header description
closablebooleantrueShow built-in round close button
closeAriaLabelstring'Close'Built-in close button aria-label
maskClassstring''Mask class
cardClassstring''Card class
border'solid' | 'dashed' | 'dash' | 'none''solid'Card border style (dash aliases dashed)
scrollablebooleantrueWhether body area scrolls internally

Events

EventParamsDescription
open-Open animation starts
opened-Open animation ends
close-Close animation starts
closed-Close animation ends
update:expanded(value: boolean)Sync expanded
update:animating(value: boolean)Sync animating

Slots

SlotParamsDescription
default{ close, expanded, animating, closable, headerTitle, headerDesc }Overlay body content
header{ close, expanded, animating, closable, headerTitle, headerDesc }Full custom header (overrides built-in header system)
header-display{ close, expanded, animating, closable, headerTitle, headerDesc }Custom built-in title/description area
header-actions{ close, expanded, animating, closable, headerTitle, headerDesc }Custom area left of close button
header-close{ close, expanded, animating, closable, headerTitle, headerDesc }Custom close area (hidden when closable=false)
Was this helpful?