---
title: "How Exact works"
description: "A visual guide to Contract, TypeScript, Rust and rightui, with a simple comparison to Expo."
---

# How Exact works

A visual guide to Contract, TypeScript, Rust and rightui, with a simple comparison to Expo.

## From your code to the screen

Exact is the complete system. Contract describes the interface. TypeScript or Rust supplies your data.

1. **You write:** Contract describes screens, styles, state and actions. rightui provides reusable Contract components.
2. **Exact builds:** the compiler checks your interface and creates a compact plan describing what to show and how to respond.
3. **Exact runs:** the runtime executes that plan. The host displays the result using the browser DOM and CSS on Web, UIKit on iOS or AppKit on macOS.

**Data at runtime:** Exact asks your TypeScript or Rust data module for API calls, storage and business logic, checks the reply and updates the UI.

You can build with **Contract + TypeScript without writing Rust**. Rust also powers parts of Exact internally; that does not make it a language you must write. Web, iOS and macOS are rightui targets; see the [compatibility table](/docs/compatibility) for checks completed on each platform.

## Inside the runtime

| Layer | Job |
| --- | --- |
| Runner | Handles events, state changes and requests to the data module. |
| Kernel | Calculates sizes and positions on native platforms. On the web, the browser uses CSS for layout. |
| Host | Displays the result with DOM, UIKit or AppKit. |

[Exact architecture](https://github.com/expo/exact/blob/53426cf02bf986a5e781abc4f953d79989c6dc05/README.md#how-it-works)

## Coming from Expo?

Expo is a framework built around React Native. Exact provides its own UI language, compiler and runtime. These are useful points of comparison, not interchangeable packages.

| Role | Expo / React Native | Exact |
| --- | --- | --- |
| Interface | React components in JSX / TSX | Components in Contract |
| UI state | React and JavaScript | Contract state and actions |
| Data logic | Usually JavaScript / TypeScript | TypeScript or Rust |
| UI library | React / React Native components | rightui Contract components |

React components cannot be imported as Contract components. rightui is written for Exact. [About the Expo framework](https://docs.expo.dev/get-started/create-a-project/)

## One example: load products

Imagine a Load products button in your app.

1. **Contract + rightui:** pressing the button triggers a Contract action. The UI can show a loading state.
2. **TypeScript or Rust:** the data module calls your API and returns product records.
3. **Exact runtime + Contract:** Exact checks the reply against the declared shape. Contract renders the products and the host displays the result.

A local interaction, like opening a menu, can stay entirely in Contract. A data request is needed only when the action needs your data module.

## Start with Contract + TypeScript

Use rightui for the components and app.ts for your data. Choose Rust when your project needs a Rust data source; the UI still stays in Contract.

Continue with [Installation](/docs/installation), the [TypeScript example](/docs/installation/typescript) or [Rust integration](/docs/installation/rust).
