Apricot is a 3D engine for Expo apps on iOS and Android. You build a scene from React components, and Apricot renders it with WebGPU inside an app screen. In web browsers without WebGPU it draws with WebGL 2. Typical scenes are a product you can spin, coins that stack, fruit that falls over a screen and piles up, a car you can drive or open door by door, and a train running a line on a map.
import { Box, Scene, Spin } from "@apricotjs/react-native";
export function SpinningCube() {
return (
<Scene style={{ flex: 1 }}>
<Spin speed={1}>
<Box size={1.6} color="#ff9f59" />
</Spin>
</Scene>
);
}This is a complete scene. It draws a lit orange cube turning on a cream background. The default look="soft" adds the lights, and the camera looks at the origin from 6 units away.
What you can build#
| Use | Examples | Guides |
|---|---|---|
| Products | A card that catches the light, a car with opening doors and paint colours, a laptop whose lid follows your finger | Models |
| Overlays | Objects that drop over an existing screen and pile up, while the screen underneath stays usable | Falling objects |
| Small worlds | A toy car you drive, a metro line with a moving train, a cinema with 448 tappable seats | Vehicles, Paths and labels, Instances |
| Arranging things by hand | Furnishing a room, setting up a beach, arranging a desk. People tap to pick up, drag and twist to turn, with undo, redo and saved layouts. | Placement, Ground and water, Lighting a room |
| Effects | Confetti for a milestone, sparkles for a reward, smoke from a chimney, snow | Particles |
How it works#
<Scene>is a React Native view. Inside it you place shapes (<Box>,<Sphere>…), models (<Model>), lights, cameras and behaviors (<Spin>,<Vehicle>,<Pile>).- Every animatable prop (
position,rotation,scale, a light'sintensity, a joint's value…) takes a plain value. With Reanimated installed, it also takes a shared value. Gestures and springs that write shared values move things without re-rendering React. - A scene that doesn't change doesn't render (
frameloop="demand", the default). - Lighting presets (
look), a studio environment for reflections (environment="studio") and 16 material presets ("chrome","car-paint","glass"…) give a lit scene with no setup. - Each separate mesh is one draw call. Use
<Instances>for many copies of one object,<Merged>to draw a piece made of many shapes as one mesh, and<Bundle>for parts of a scene that don't move.
Packages#
| Package | What it contains | Import from |
|---|---|---|
@apricotjs/react-native |
<Scene>, shapes, lights and lamps, cameras, behaviors, instances, labels, paths, placement and layouts, ground and water, hooks, the Expo config plugin |
@apricotjs/react-native |
@apricotjs/react-native/model |
<Model>, model kits, useModel, useTexture, downloads |
@apricotjs/react-native/model |
@apricotjs/assets |
Ready-made objects: MoneyStack, Coin, Apple, Peach, Car, Card, Trees, Ground, ContactShadow, Backdrop, StudioFloor |
@apricotjs/assets |
@apricotjs/core |
The engine without React, and utilities such as seededRandom, Path and Trip |
@apricotjs/core |
@apricotjs/metro |
withApricot() for metro.config.js, and the apricot-models CLI that optimises and inspects .glb files |
@apricotjs/metro |
Requirements at a glance#
- Expo SDK 57, the New Architecture, and a development build (Expo Go cannot load WebGPU).
- On the web: a browser with WebGPU or WebGL 2. See On the web.
- iOS, and Android 8.0 or later (
minSdkVersion26, set for you by the config plugin). - Required peers:
react-native-webgpuandthree(r186). Optional, for the features that use them:react-native-reanimated4 withreact-native-worklets(shared values),expo-assetandexpo-file-system(bundled models and textures, saved layouts).
Full steps: Installation.
Where to go next#
- Installation: add Apricot to an Expo app.
- Quick start: build a first scene and make it interactive, step by step.
- Building with AI: the rules an AI assistant needs to write correct Apricot code. If you use one, give it llms.txt.
- Core concepts: how scenes, units, animation and objects work.
- API reference: every component, prop and default.