Files
wehub-resource-sync e30e75b5d4
Changesets / Create Version PR (push) Has been cancelled
Deploy Shadcn Registry / Deploy Production (push) Has been cancelled
Template Metrics / LOC + Bundle Size (push) Has been cancelled
Code Quality / Oxlint + Oxfmt (push) Has been cancelled
Code Quality / Template Sync (push) Has been cancelled
Code Quality / Build Changed Packages (push) Has been cancelled
Code Quality / Test Changed Packages (push) Has been cancelled
Deploy Expo Example / Deploy Production (push) Has been cancelled
Deploy Ink Example / Deploy Production (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.12) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:40:13 +08:00

49 lines
1.6 KiB
Markdown

# `@assistant-ui/react-native`
[![npm version](https://img.shields.io/npm/v/@assistant-ui/react-native)](https://www.npmjs.com/package/@assistant-ui/react-native)
[![npm downloads](https://img.shields.io/npm/dm/@assistant-ui/react-native)](https://www.npmjs.com/package/@assistant-ui/react-native)
[![GitHub stars](https://img.shields.io/github/stars/assistant-ui/assistant-ui)](https://github.com/assistant-ui/assistant-ui)
![License](https://img.shields.io/npm/l/@assistant-ui/react-native)
React Native bindings for assistant-ui. Native primitives for `Thread`, `Composer`, `Message`, and `ThreadList` that share the same runtime and adapters as `@assistant-ui/react`.
## Installation
```bash
npm install @assistant-ui/react-native
```
## Usage
```tsx
import {
AssistantRuntimeProvider,
useLocalRuntime,
type ChatModelAdapter,
} from "@assistant-ui/react-native";
const adapter: ChatModelAdapter = {
async *run({ messages }) {
yield { content: [{ type: "text", text: "Hello!" }] };
},
};
export function App() {
const runtime = useLocalRuntime(adapter);
return (
<AssistantRuntimeProvider runtime={runtime}>
{/* Thread, Composer, Message primitives */}
</AssistantRuntimeProvider>
);
}
```
## Documentation
Full primitives, hooks, and adapter reference at [assistant-ui.com/docs/react-native](https://www.assistant-ui.com/docs/react-native).
## For other platforms
- Web: [`@assistant-ui/react`](https://www.npmjs.com/package/@assistant-ui/react)
- Terminal (Ink): [`@assistant-ui/react-ink`](https://www.npmjs.com/package/@assistant-ui/react-ink)