Fallback Card

Elegant fallback cards with animated glitch effects for unavailable content

Preview not available

Install the component using the shadcn CLI:

npx shadcn@latest add @uimix/fallback-card

This will automatically add the component to your project.

Copy and paste the following code into your project:

Loading source…

Features

  • ASCII Glitch Effect: Animated ASCII character background with customizable colors and speed
  • Theme Support: Dark and light theme variants with appropriate color schemes
  • Customizable Icon: Optional SVG icon display with shadow effects
  • Flexible Sizing: Adjustable card dimensions and glitch effect positioning
  • Smooth Animations: Canvas-based glitch animations with smooth color transitions
  • Edge Vignette: Built-in vignette effects for polished visual appearance
  • Responsive Design: Adapts to different container sizes

Usage

Loading source…

Props

PropTypeDefaultDescription
messagestringundefined

Message to display in the card center

theme'dark' | 'light'undefined

Visual theme for the card

showIconbooleanundefined

Whether to display the monitor icon

showGlitchbooleanundefined

Whether to display the glitch effect background

glitchOffsetXnumberundefined

Horizontal offset for the glitch effect (in pixels)

glitchOffsetYnumberundefined

Vertical offset for the glitch effect (in pixels)

glitchScalenumberundefined

Scale factor for the glitch effect

cardWidthnumberundefined

Card width in pixels (max-width)

cardHeightnumberundefined

Card height in pixels

classNamestringundefined

Additional CSS classes to apply to the root element

Usage Examples

Basic Usage

<FallbackCard 
  message="Preview not available"
  theme="dark"
/>

Custom Glitch Position

<FallbackCard 
  message="Content unavailable"
  glitchOffsetX={150}
  glitchOffsetY={170}
  glitchScale={1.6}
/>

Custom Size

<FallbackCard 
  message="Loading failed"
  cardWidth={600}
  cardHeight={550}
/>

Light Theme

<FallbackCard 
  message="Content not found"
  theme="light"
/>

Without Glitch Effect

<FallbackCard 
  message="Error loading content"
  showGlitch={false}
/>

Minimal Design

<FallbackCard 
  message="Unavailable"
  showIcon={false}
  showGlitch={false}
/>