Applies to every preview on the site.
Installation
One command copies the source into your app — you own the code and can change anything.
After you add the file, import it like any local component:
import { TiltCard } from "@/components/ui/tilt-card";Or add it with the CLI (installs any missing peers):
Usage
useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| children Content (sets the card's size). Wrap parts in <TiltLayer depth> to float them. | ReactNode | — |
| image Photo that fills the card behind the content. | ImageSourcePropType | — |
| shade Darkens the bottom of the photo so white text stays readable (0–1). | number | 0.6 |
| maxTilt Tilt in degrees at the card's edge. | number | 12 |
| pressScale Scale while touched. | number | 1.03 |
| glare Light reflection that follows your finger. "holo" adds a rainbow foil sheen that shifts as the card leans. | "soft" | "sharp" | "holo" | "none" | "soft" |
| glareClip Where the reflection may fall (card points) — for cards with cut-outs, so light never shows over a hole. | { x, y, width, height }[] | whole card |
| perspective Depth of the effect — smaller is more dramatic. | number | 800 |
| idle Slowly sway while untouched. | boolean | false |
| radius Corner radius. | number | 20 |
| shadow Soft shadow under the card that shifts as it tilts. | boolean | true |
| disabled Turn touch tilting off. | boolean | false |
| onPress Fires on a tap (not after a drag). | () => void | — |
| accessibilityLabel Label for screen readers. | string | — |
| style Style for the card (width, margins). | StyleProp<ViewStyle> | — |
| className Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. | string | — |
| TiltLayer.depth How far a layer floats above the card (negative sinks below). | number | 0.5 |
| TiltFoil A holographic foil patch (seal, sticker, strip) whose rainbow shifts as the card leans. | { children?, radius?, base?, style? } | — |
| useTilt() The card's live tilt values (native-driver friendly) for your own effects. | () => { tx, ty, press, width, height } | null | — |
Customization
You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.
Design theme
Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).
Variants
Use the variant chips on the preview to switch examples; each maps to a demo you can copy from the Code tab.
Style props
React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).
- style
- StyleProp<ViewStyle>Style for the card (width, margins).
- className
- stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.
Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.
Behaviour & accessibility
- Touch
- Press and drag to tilt up to maxTilt degrees; the card scales by pressScale and springs flat on release. onPress fires on a tap, not after a drag.
- Motion
- The shadow slides away from the light and the glare (soft, sharp or holo) glides across. TiltLayer children float at their own depth, and idle makes it sway gently at rest.
- Screen readers
- Exposed as one element when it has onPress or accessibilityLabel; with onPress it is a button with an 'activate' action.
Source
FAQ
How do I make a tilt card in React Native?
npx @expokit/cli@latest add tilt-card in your Expo or React Native project and it copies a ready-made tilt card into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.Does Tilt Card work in Expo Go?
react-native-svg) are all included in Expo Go.How do I add Tilt Card to my Expo app?
npx @expokit/cli@latest add tilt-card in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.