Gradient card
A card whose background is a soft field of colour glows that slowly travel and cross-fade, with a title, description, count chip and arrow, and a switch for every animation.
npx @swipeui/cli add gradient-cardWhen to use it
- A home screen with a few big destinations, such as Components, Themes and Motion, each with a count.
- One hero message with its own button, such as a plan upgrade or a new feature.
- A section header card that should feel alive without a photo or an illustration.
- Onboarding or empty states where a calm moving colour field sets the mood.
When not to use it
- Long lists of cards; the glows are for a handful of moments, not every row.
- Content led by a photo. Cover card makes the photo the whole card.
- Dense data such as a balance or a metric trend. Metric card shows the number and its history.
- Screens that already move a lot; one expressive background per view is enough.
Installation
Installs with a Pro licence
Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.
Usage
import { GradientCard } from '@/components/swipeui/card/gradient-card';
<GradientCard
eyebrow="145 total"
title="Components"
description="Explore every component"
palette={['--color-chart-1', '--color-chart-2']}
onPress={() => router.push('/components')}
/>;Examples
destinations and hero. The app and public preview use the same content and variant names. The Animation and Palette settings sit outside the card.
Use it for a handful of destinations on a home screen, or one hero message with its own button. Give each card on a screen a different palette or token pair so they read as distinct places.
Settings
| Setting | Default | Behavior |
|---|---|---|
title | required | The card's name, read first. |
description | absent | One or two short lines under the title. |
eyebrow | absent | A small chip above the title, such as "145 total"; a string or your own node. |
action | arrow when pressable | Trailing action beside the title; false hides it. |
onPress | absent | Opens whatever the card stands for; the whole card presses in with a light haptic. Ignored when children add their own actions. |
children | absent | Extra content under the details, such as the card's own button. The card itself is then not pressable. |
disabled | false | Stops pressing and dims the card. |
haptics | true | A light haptic tap on press. |
size | 'lg' | lg (232pt minimum) for a destination or hero, md (168pt) for a denser stack. |
palette | 'theme' | theme (the preset's chart colours), aurora, sunset, ocean, candy, or at least two colours and --color-* tokens. |
animated | true | Master switch for every animation; off draws a still glow. |
orbit | true | The glows travel slowly around their corner. |
drift | true | The colours cross-fade into a shifted set, so a lap never looks the same. |
speed | 1 | Playback rate; must be positive and finite. |
intensity | 0.8 | Glow strength from 0 to 1. Light schemes are softer automatically. |
origin | 'bottom-end' | Where the light gathers: top-start, top-end, bottom-start, bottom-end or center. Start and end follow the reading direction. |
washes | palette length | How many glows are drawn, from 1 to 8. |
active | true | Explicit pause for hidden routes. Offscreen and background pauses are automatic. |
motion | app feel | Shared ambient feel; Reduce Motion holds a still glow. |
accessibilityLabel | chip, title and description | Spoken name. |
accessibilityHint | absent | What pressing the card does. |
className | absent | Root classes. |
style | absent | Native layout escape hatch. |
testID | absent | Root ID. |
Accessibility
A pressable card is one button read as its chip, title and description. With children, the details are one focus stop and the children keep their own controls. The glows and the arrow are decorative. Under Reduce Motion the glow holds still, and glows are softer in light schemes so text over them keeps its contrast.
Behavior and gestures
- With onPress the whole card presses in with a light haptic and shows an arrow; action replaces the arrow and action={false} hides it.
- children add content under the details, such as the card's own button; the card itself is then not pressable.
- animated switches every animation off at once; orbit (glows travel) and drift (colours cross-fade) switch each part on its own.
- palette takes a named palette or your own colours and --color-* tokens; the default theme palette follows the preset's chart colours.
- origin chooses the corner where the light gathers (start and end follow the reading direction); intensity sets how strong the glow is.
- speed changes the pace, washes the number of glows, and active pauses a card on a hidden route.
Accessibility
- A pressable card is one button read as the chip, title and description, such as "145 total, Components, Explore every component".
- With children the details are one focus stop and the children keep their own controls.
- The glow and the arrow are decorative and hidden from assistive technology.
- Glows are softer in light schemes so text over them keeps its contrast; check custom palettes in both schemes.
Motion
- Uses the
ambientandpressmotion roles, so it follows your app's feel. Passmotionto tune this one instance. - The glows move on the ambient role at a slow linear pace and pause offscreen, in the background and when active is false.
- Under Reduce Motion the card holds a still glow; the press keeps only its haptic.
Performance
- Each glow is drawn once into its own rasterized layer and then only moved by transform and faded by opacity on the UI thread, so scrolling stays smooth with several animated cards on screen; nothing re-renders or redraws while they move.
Notes for AI
- Give each card on one screen a different palette or token pair so they read as distinct destinations.
- Keep the title short and the description to one line; the eyebrow suits a count such as "6 total".
- Pass animated={false} where motion would distract, such as behind a form.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.