Visual Cards
FlipCard, TiltCard, RevealCard, and GlowCard are CSS-only visual card primitives for premium landing pages, portfolios, dashboards, and product surfaces.
They are part of core Faststrap and use Bootstrap/Faststrap theme variables. No JavaScript is required.
Quick Start
from faststrap import Button, FlipCard, GlowCard, RevealCard, TiltCard
FlipCard(
front="Plan summary",
back=Button("Upgrade", variant="light"),
height="260px",
)
TiltCard("Hover me", cls="card-body")
RevealCard(
"/static/room.jpg",
"Harbor Suite",
description="Private terrace, skyline view.",
action=Button("View Room", variant="light"),
)
GlowCard("Important metric", glow_color="#38bdf8", intensity="high", cls="card-body")
Components
| Component | Purpose |
|---|---|
FlipCard |
Two-sided card that flips on hover or focus-within. |
TiltCard |
Card with subtle 3D lift on hover. |
RevealCard |
Image card with a hover-revealed overlay. |
GlowCard |
Card with configurable glow intensity and color. |
Parameters
FlipCard
| Parameter | Type | Default | Description |
|---|---|---|---|
front |
Any |
required | Front face content. |
back |
Any |
required | Back face content. |
height |
str \| None |
300px |
Card height. |
width |
str \| None |
100% |
Card width. |
duration |
str \| None |
0.6s |
Flip animation duration. |
RevealCard
| Parameter | Type | Default | Description |
|---|---|---|---|
img_src |
str |
required | Image URL. |
title |
str |
required | Overlay heading and default image alt text. |
description |
str \| None |
None |
Overlay copy. |
action |
Any \| None |
None |
Optional action element. |
alt |
str \| None |
title |
Image alt text. |
height |
str \| None |
300px |
Card height. |
GlowCard
| Parameter | Type | Default | Description |
|---|---|---|---|
glow_color |
str \| None |
var(--bs-primary) |
CSS color for the glow. |
intensity |
low \| medium \| high |
medium |
Glow strength. |
Notes
- These components are marked
@betabecause they are visual primitives newly absorbed into core. faststrap-visual.cssis loaded automatically byadd_bootstrap().- Motion respects
prefers-reduced-motion.
API Reference
faststrap.components.display.visual_cards.FlipCard(front, back, *, height=UNSET, width=UNSET, duration=UNSET, **kwargs)
Render a CSS-only 3D flip card.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
front
|
Any
|
Content for the front face. |
required |
back
|
Any
|
Content for the back face. |
required |
height
|
str | None
|
Card height. Defaults to |
UNSET
|
width
|
str | None
|
Card width. Defaults to |
UNSET
|
duration
|
str | None
|
Flip animation duration. Defaults to |
UNSET
|
**kwargs
|
Any
|
Additional HTML attributes. |
{}
|
Source code in src/faststrap/components/display/visual_cards.py
faststrap.components.display.visual_cards.TiltCard(*children, **kwargs)
Render a card with a subtle 3D hover lift.
Source code in src/faststrap/components/display/visual_cards.py
faststrap.components.display.visual_cards.RevealCard(img_src, title, *, description=None, action=None, alt=None, height=UNSET, **kwargs)
Render an image card that reveals content on hover.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img_src
|
str
|
Background image URL. |
required |
title
|
str
|
Overlay heading. |
required |
description
|
str | None
|
Optional overlay copy. |
None
|
action
|
Any | None
|
Optional action element, such as a |
None
|
alt
|
str | None
|
Image alt text. Defaults to |
None
|
height
|
str | None
|
Card height. Defaults to |
UNSET
|
**kwargs
|
Any
|
Additional HTML attributes. |
{}
|
Source code in src/faststrap/components/display/visual_cards.py
faststrap.components.display.visual_cards.GlowCard(*children, glow_color=UNSET, intensity=UNSET, **kwargs)
Render a card with an animated glow on hover.