Installation

Add rightui components to your Exact app. Current release: 0.4.0-beta.4 (beta).

Install with your AI agent

Copy this prompt into any coding agent. It will check your project, install rightui and add a working component.

Before you start

Use an Exact app and Bun 1.4.2. This beta is tested with expo/exact revision 53426cf. If you are new to Exact, follow its setup guide and create an app first. Run the following commands from your app directory. For a visual introduction to the layers, read How Exact works.

Install the package

Install the shared component package once. Choose the package manager you use in your project. Pin the version while rightui is in beta.
bun add --exact @rightui/ui@0.4.0-beta.4

Allow the font marker

Add rightui-font to the top-level data allowlist in app.json. Merge it with existing entries. RightUI uses this marker to identify text that follows the body typeface.
json
{
"data": ["rightui-font"]
}

Add the typeface

Copy the bundled Geist and Newsreader families with their licenses. Declare their regular and italic faces at the top of app.contract, as shown in the next step.
sh
mkdir -p assets/fonts
cp node_modules/@rightui/ui/assets/fonts/Geist.ttf assets/fonts/
cp node_modules/@rightui/ui/assets/fonts/Geist-Italic.ttf assets/fonts/
cp node_modules/@rightui/ui/assets/fonts/OFL.txt assets/fonts/
cp node_modules/@rightui/ui/assets/fonts/OFL-Italic.txt assets/fonts/
cp node_modules/@rightui/ui/assets/fonts/Newsreader.ttf assets/fonts/
cp node_modules/@rightui/ui/assets/fonts/Newsreader-Italic.ttf assets/fonts/
cp node_modules/@rightui/ui/assets/fonts/OFL-Newsreader.txt assets/fonts/

Use your first component

Copy this example into app.contract in a new app, or adapt the import and Button call in your existing view. The counter uses local state; the greeting comes from app.ts below. Every app root must provide uiFont = "theme" and uiWeights = defaultFontWeights(), even with the default theme. Merge this with any existing provide block; descendants inherit the selected font.
contract
use defaultFontWeights from "@rightui/ui"
font "Geist"
100 900 = "assets/fonts/Geist.ttf"
100 900 italic = "assets/fonts/Geist-Italic.ttf"
font "Newsreader"
200 800 = "assets/fonts/Newsreader.ttf"
200 800 italic = "assets/fonts/Newsreader-Italic.ttf"
use uiFontFamily, Button from "@rightui/ui"
shape Greeting
label: string
component App
provide
uiFont = "theme"
uiWeights = defaultFontWeights()
resource greeting = greeting() as shape Greeting
state count = 0
action increment
count = count + 1
view
column padding=24 gap=12 color="ui.foreground" background-color="ui.background"
text greeting.label font-family=uiFontFamily("theme") data-rightui-font="body"
text count.toString() testId="counter" font-family=uiFontFamily("theme") data-rightui-font="body"
Button(id="increment", label="Increment", variant="primary", disabled=false, press=increment)

Add the data module

Use this as app.ts for the example. It answers the greeting requested by app.contract. The next command generates its Answer type.
typescript
import type { Answer } from './app.contract.d.ts';
export const grants = '';
export const answer: Answer = (source) => {
if (source === 'greeting') return { label: 'Hello from TypeScript' };
throw new Error(`Unknown source: ${source}`);
};

Enable code-block copying

If you use CodeBlock, CodeBlockAdvanced, CodeBlockAI or CodeBlockFrame, merge this controller into your application root. It copies the original text and resets feedback after three seconds; a repeated copy restarts the delay. Keep the font declarations and app.json metadata from the steps above. Exact dispatches the platform clipboard command but does not report its success back to Contract.
contract
use defaultFontWeights from "@rightui/ui"
use CodeBlock from "@rightui/ui"
component App
state copiedId = ""
state copiedText = ""
state copyVersion = 0
provide
uiFont = "theme"
uiWeights = defaultFontWeights()
uiCopiedId = copiedId
uiCopiedText = copiedText
uiCopyCode = copyCode
action copyCode(id: string, text: string)
copyText(text)
copiedId = id
copiedText = text
copyVersion = copyVersion + 1
action clearCopyFeedback
copiedId = ""
copiedText = ""
task copiedFeedback when copiedId != "" key=copyVersion
after(3000, clearCopyFeedback)
view
CodeBlock(id="example", title="hello.ts", language="ts", code="console.log('Hello')", numbers=false, diff=false)

Start the app

Run the web preview from your app directory. Press Increment to check that the component responds. For data integration, continue with the TypeScript guide or Rust guide.
sh
bun exact.mjs contract types app.contract -o app.contract.d.ts
bun exact.mjs web

Add more components

Browse Components for live previews, imports and props. Every component uses the same @rightui/ui package. AI Elements and Blocks are source patterns you can copy and adapt.

Update your version

Read the changelog before installing a newer beta, then build and test your app. Commit package.json and your lockfile together. To roll back, reinstall the previous exact version. Keep your Exact SDK version unchanged unless the release notes require an upgrade.
sh
bun add --exact @rightui/ui@0.4.0-beta.4

Platform support

Rightui targets Web, iOS and macOS. Windows and Android are not supported. See the compatibility table for the checks completed for each component. Rightui remains in beta; there is no stable release yet.