BuilderIO/agent-native / packages/core/docs
agent-native-docs
UnverifiedHow to look up version-matched Agent-Native framework docs and source in node_modules. Use before coding against @agent-native/core APIs or advanced features.
content/getting-started-pages.mdx
View on GitHub---
title: "Add a Page"
description: "Build a React route that calls your action and displays its result."
---
# Add a Page
This is part three of the Getting Started series. In [Add an Action](/docs/getting-started-actions)
you created `analyze-text`. Here you'll call that same action from a route. This
example does not need a new database table. Chat already stores chat history in
SQL; add your own tables when you need to persist domain data.
## Create the route {#add-a-page}
The dev server reads route files when it starts. Create
`app/routes/text-analyses.tsx`, then restart `pnpm dev` if it is already
running. Open the local URL printed by `pnpm dev` and append
`/text-analyses`; the port may change when 8080 is already in use.
```tsx filename="app/routes/text-analyses.tsx"
import { useActionQuery } from "@agent-native/core/client/hooks";
type TextAnalysis = {
summary: {
characters: number;
words: number;
sentences: number;
paragraphs: number;
};
};
export default function TextAnalysesRoute() {
const { data: analysis, isLoading } = useActionQuery<TextAnalysis>(
"analyze-text",
{ text: "Hello world. How are you today?" },
);
return (
<main className="mx-auto flex max-w-3xl flex-col gap-6 p-6">
<header>
<h1 className="text-2xl font-semibold">Text analyses</h1>
<p className="text-muted-foreground">The same action, on a page.</p>
</header>
<section className="grid gap-3 sm:grid-cols-2">
{isLoading && <p className="text-muted-foreground">Analyzing...</p>}
{analysis &&
Object.entries(analysis.summary).map(([label, value]) => (
<article key={label} className="rounded-lg border p-4">
<p className="text-sm capitalize text-muted-foreground">
{label}
</p>
<p className="text-2xl font-semibold">{value}</p>
</article>
))}
</section>
</main>
);
}
```
`useActionQuery` calls the same read-only action the agent uses. The page does
not need a custom API route, a second data layer, or a new SQL table.
Open the printed local URL with `/text-analyses` appended, or ask the agent:
> Navigate to `/text-analyses`.
The route is enough for this tutorial. Add a sidebar entry later if this becomes
a primary workflow. For the full `view-screen`, `navigate`, and application-state
patterns, see [Context Awareness](/docs/context-awareness).
## Continue
You've built a chat app with an action and a page that calls the same source of
truth. Continue with [Key Concepts](/docs/key-concepts) or
[Agent Surfaces](/docs/agent-surfaces).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 197k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |