# Tilt Card — React Native component for Expo

> A card that leans toward your finger in 3D while a glare slides across it.

A card that tilts toward your finger in 3D — it lifts, its shadow slides away from the light and a reflection (or a rainbow holo sheen) glides across it. Give it a photo (`image`), float content in TiltLayers, and add TiltFoil seals that shimmer as it leans.

- Docs: https://expokit.in/docs/components/tilt-card
- Tier: Free
- Also called: tilt card, 3D hover card, gyroscope card
- Category: 3D
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg
- Uses ExpoKit items: kit
- Variants: Travel Card, Now Playing, Product, Feed Card

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add tilt-card
```

The CLI copies the source into your project (you own the code) and installs react-native-svg.

Import: `import { TiltCard } from "@/components/ui/tilt-card";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Content (sets the card's size). Wrap parts in <TiltLayer depth> to float them. |
| `image` | `ImageSourcePropType` | — | Photo that fills the card behind the content. |
| `shade` | `number` | `0.6` | Darkens the bottom of the photo so white text stays readable (0–1). |
| `maxTilt` | `number` | `12` | Tilt in degrees at the card's edge. |
| `pressScale` | `number` | `1.03` | Scale while touched. |
| `glare` | `"soft" \| "sharp" \| "holo" \| "none"` | `"soft"` | Light reflection that follows your finger. "holo" adds a rainbow foil sheen that shifts as the card leans. |
| `glareClip` | `{ x, y, width, height }[]` | `whole card` | Where the reflection may fall (card points) — for cards with cut-outs, so light never shows over a hole. |
| `perspective` | `number` | `800` | Depth of the effect — smaller is more dramatic. |
| `idle` | `boolean` | `false` | Slowly sway while untouched. |
| `radius` | `number` | `20` | Corner radius. |
| `shadow` | `boolean` | `true` | Soft shadow under the card that shifts as it tilts. |
| `disabled` | `boolean` | `false` | Turn touch tilting off. |
| `onPress` | `() => void` | — | Fires on a tap (not after a drag). |
| `accessibilityLabel` | `string` | — | Label for screen readers. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the card (width, margins). |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |
| `TiltLayer.depth` | `number` | `0.5` | How far a layer floats above the card (negative sinks below). |
| `TiltFoil` | `{ children?, radius?, base?, style? }` | — | A holographic foil patch (seal, sticker, strip) whose rainbow shifts as the card leans. |
| `useTilt()` | `() => { tx, ty, press, width, height } \| null` | — | The card's live tilt values (native-driver friendly) for your own effects. |

## 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.

## FAQ

### How do I make a tilt card in React Native?

Use ExpoKit's Tilt Card: run 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?

Yes. Tilt Card runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.

### How do I add Tilt Card to my Expo app?

Run 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.

### Is Tilt Card free?

Yes. Tilt Card is free: its full source is on this page and the CLI installs it without an account.

## More

- Live preview, variants and code: https://expokit.in/docs/components/tilt-card
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
