# accessibility --- title: Accessibility description: Build on accessible primitives and verify the complete experience. --- ## Behavior Interactive primitives use Base UI for React and Reka UI for Vue where applicable: focus management, dialogs, menus, comboboxes, tabs and notifications. Native inputs retain form semantics. Always supply meaningful labels, associate descriptions with controls, and provide visible feedback for asynchronous actions. Do not use a placeholder as the only label. ## Keyboard - Use Tab and Shift+Tab to move between controls. - Menus and comboboxes support arrow keys and selection through their framework’s accessible primitives. - Escape closes dismissible overlays; focus returns to their trigger. - The calendar uses arrow keys for days/weeks, Home/End for week boundaries and PageUp/PageDown for months. Shift with PageUp/PageDown changes the year. - The editor supports Command/Ctrl+K for search and Command/Ctrl+I for the assistant. ## Visual changes need checks The editor evaluates semantic text color pairs. This is one check, not an accessibility certification. Check disabled states, images, focus indicators, errors, screen-reader announcements and zoom in your actual app. Reduced-motion preferences disable decorative animation. Do not communicate status through color alone. Keep controls usable on touch screens and do not remove visible focus styles. ## Early access Components remain experimental while the catalogue is being tested and integrated. Storybook provides light, dark, compact and shape variations so changes can be inspected consistently. --- # agents --- title: CLI and coding agents description: Connect your project and give your coding agent the same components, tokens and design rules you use in the editor. --- You can work entirely from an exported ZIP. Use a connection when you want your terminal or coding agent to read the latest saved version of a library. The [MIT-licensed component source](https://github.com/elreco/coderocket-ui) is available without a CodeRocket account. The hosted registry used by the CLI and MCP requires an account, a saved library and a connection token. Installed source runs locally without a connection. ## Create a connection 1. Save the library in the editor, then open **Connect**. 2. Name the connection for the machine or agent that will use it. 3. Choose **Create connection** and copy the token shown once. 4. Copy the generated setup commands or MCP configuration into your development environment. A connection can read only its library. It expires after 90 days and can be revoked from the same dialog. Put its token in your terminal or agent's protected environment; keep it out of source files, prompts and public URLs. ## Install with the CLI With **Node.js 24 or newer** installed, run the official npm package from your application folder. Copy your library ID from **Connect** and provide the token in your terminal environment: In bash or zsh, paste your connection token at the hidden prompt and press Enter: ```bash printf "Connection token: " read -rs CODEROCKET_TOKEN export CODEROCKET_TOKEN printf "\n" npx @coderocketapp/cli@latest init YOUR_LIBRARY_ID npx @coderocketapp/cli@latest add button dialog ``` The CLI remembers the library in `.coderocket/manifest.json`; it never writes the token to project files. Keep `CODEROCKET_TOKEN` available for later commands, including in new terminals. You can instead set `CODEROCKET_LIBRARY` and run `npx @coderocketapp/cli@latest init` without a positional ID. No global installation is required. | Command | Result | | ------------------------------------------------- | ---------------------------------------------------------- | | `npx @coderocketapp/cli@latest list` | List available components and blocks | | `npx @coderocketapp/cli@latest add button dialog` | Install named components and their required shared files | | `npx @coderocketapp/cli@latest add block-login` | Install a complete block | | `npx @coderocketapp/cli@latest add --all` | Install the full catalogue | | `npx @coderocketapp/cli@latest sync` | Update installed items from the latest saved version | | `npx @coderocketapp/cli@latest import` | Write a local analysis report for importing project tokens | Install the listed runtime dependencies and import the generated styles once. See [export and installation](/docs/export) for React/Next.js, or [Vue and Nuxt setup](/docs/vue). The connection reads the framework from your saved library and serves the matching source and dependencies. Commit `.coderocket/manifest.json` and `.coderocket/lock.json` with the installed source. The CLI writes integration instructions and agent rules to `.coderocket/README.md` and `.coderocket/AGENTS.md`. The `import` command analyzes local files without uploading them and does not require a token. `CODEROCKET_SERVER` defaults to `https://ui.coderocket.app`. If you use a different Studio deployment, set its origin in the environment before `init` and keep it set for subsequent commands. **Connect** includes that variable when needed. ### Your local edits stay yours The CLI compares file hashes before applying an update. If it finds a local edit or deletion, it stops the installation and writes the proposed changes into a `.coderocket/review-*` folder. Review and merge those changes in your codebase; the CLI does not silently replace your work. Save changes in the editor before syncing. A connection reads saved versions, not another browser's unsaved preview. ## Use the shadcn registry (React) Vue libraries use the CodeRocket CLI or MCP above. The instructions below target React projects. Open **Connect → shadcn registry** and copy the registry entry into your existing `components.json`. The configuration uses an authorization header from your environment to keep the library private. You can then install a component through your configured registry: ```bash npx shadcn@latest add @coderocket/button ``` The local-change protection described above belongs to the CodeRocket CLI. When using another installer, review its proposed changes and your version-control diff. ## Connect an agent with MCP Open **Connect → Coding agents · MCP** to copy the configuration for your saved library. Use Node.js 24 or newer and an MCP client that supports local stdio servers: ```json { "mcpServers": { "coderocket": { "command": "npx", "args": ["-y", "@coderocketapp/mcp@latest"], "env": { "CODEROCKET_LIBRARY": "YOUR_LIBRARY_ID", "CODEROCKET_TOKEN": "YOUR_CONNECTION_TOKEN" } } } } ``` Replace the placeholders in your client's private configuration and keep it outside version control. If the client has protected secret settings, provide `CODEROCKET_TOKEN` there and remove its entry from the JSON. Restart or reconnect the MCP server after configuration. The token is passed to the server as an environment variable. The connector gives your agent read access to: - The saved design model, tokens and revision. - Design rules and integration conventions. - Component and block search. - Source files, dependencies and installation paths. For example, you can ask an agent to “build a settings form using this library's input, select and button components.” The agent has the source and design context it needs to reuse your library. Design changes still happen in the editor, where you review and save them. The MCP server reads the library; your agent uses its own tools and permissions to edit your application. If the token expires or is revoked, create a new connection for the same library, update the environment and reconnect. ## Include your design rules Every source export includes `AGENTS.md` with the library's conventions. It asks agents to reuse existing controls, consume semantic tokens, and preserve keyboard and focus behavior. If your project already has an `AGENTS.md`, merge the relevant design rules into it. Preserve your existing project-specific instructions. ## Give an assistant the public reference Use **Copy for AI** on any documentation page. Paste the result into your preferred assistant, such as ChatGPT, Claude, Cursor, Copilot or Codex, and describe what you want to build. The copied context includes this page’s Markdown and links to source installation and agent setup. It works without a CodeRocket connection. This is the **public reference**. To work with your own saved components and theme, give your coding agent the exported files or [connect it through MCP](#connect-an-agent-with-mcp). Keep connection tokens in the agent’s protected environment settings. Component and block pages also offer **Open in editor**. Choose an existing library or create one; the editor keeps the component you selected. You can customize its design, inspect its code and export the source from there. The **Markdown** link opens a plain-text version of the page, useful for both people and tools. [`/llms.txt`](/llms.txt) provides the documentation index; [`/llms-full.txt`](/llms-full.txt) contains the full collection for tools that need it. --- # ai --- title: Work with the assistant description: Ask for a change, review the proposal, then apply it. --- The assistant is an interface to your design-system model. It does not rewrite the entire component library for every prompt. ## Be specific > Use warmer surfaces and rounder cards, but keep the current primary color and button corners. The server requests a structured proposal from Gemini. The proposal is checked against the model schema and supported token paths. Color changes are checked for text contrast. Invalid output can be repaired once; it is not silently applied. ## Review before applying The proposal lists the values that would change. **Apply to preview** changes the local editor state. **Save** creates a persistent version. Undo remains available before saving. If you edit the design while a proposal is in progress, the old proposal cannot overwrite your newer changes. Request another proposal using the updated design. ## Missing information An ambiguous request may return a clarification. No changes accompany a clarification. Add the missing details to your prompt and try again. ## Privacy and availability The prompt and the current design values are sent to Google's Gemini service to produce a response. Provider keys stay on the server. CodeRocket does not store raw prompts in its application history; it stores the validated proposals used to explain changes. If Gemini is unavailable or not configured, the assistant reports the issue. The visual editor, existing components and exports remain usable. There is no simulated AI response. ## Create a component or block Use **Create component** in the editor to describe a form, card, settings panel or file selector. Gemini composes the existing primitives into a structured tree. The renderer produces editable React or Vue sources, matching the library’s framework, from that tree; generated strings are never executed as JavaScript. Review the preview, source and specification, then choose **Accept and save component**. The accepted component becomes part of the library's exports, registry and MCP catalogue. Its version is stored with its specification, source and validation metadata. This early-access generator supports composition of the available layout and form primitives. It does not invent a working backend or arbitrary new browser behavior. File selection stays local until your application's callback handles it; application buttons use the `onAction` prop in the exported source. The schema, tree and labels are checked before the preview. The editor then runs axe accessibility checks on the rendered preview; acceptance stays disabled until those checks pass. Components remain **experimental** until you test the integration, keyboard behavior and application actions in their final context. ## Source, tests and stories Accepted compositions include their structured specification, editable React or Vue source, an SSR smoke test and a Storybook story in the ZIP export. Connect the exported stories to your application's Storybook theme decorator. Run the tests and accessibility checks in that application before promoting an experimental component to production. The current generator assembles validated primitives. It does not execute arbitrary generated JavaScript or invent application backends. Unsupported behavior requires clarification and implementation in your own action callbacks. ## Use your library with a coding agent To give your coding agent the saved design rules and catalogue, open **Connect → Coding agents · MCP**. The official npm server runs with `npx -y @coderocketapp/mcp@latest` and requires Node.js 24 or newer. Set `CODEROCKET_LIBRARY` and `CODEROCKET_TOKEN` in the MCP client's environment, using the library-scoped connection created in the Studio. Keep tokens out of prompts and source files. [Copy the complete MCP configuration](/docs/agents#connect-an-agent-with-mcp). The MCP server provides read-only access to the saved library. Your agent can fetch source and use its own tools to integrate it into your app. Save Studio changes before requesting an updated design. To install and sync from a terminal, use `npx @coderocketapp/cli@latest init YOUR_LIBRARY_ID` with the token in your environment, then `add` or `sync` as shown in the [CLI guide](/docs/agents#install-with-the-cli). Hosted connections require an account and a saved library. The public documentation and [MIT-licensed component source](https://github.com/elreco/coderocket-ui) can be used with an assistant without an account or connection token. --- # blocks/api-keys --- title: "API Keys" description: "A masked key list with creation and revocation callbacks." --- Interactive preview: https://ui.coderocket.app/docs/blocks/api-keys ## Usage Get this block from a [saved library export](/docs/export) or the [connected CLI](/docs/agents). The imports below refer to local files installed in your app. Import `styles/components.css`, then `styles/blocks.css`, then `styles/theme.css` once. Wrap your app in `ThemeScope` from `components/ui/utils` so typography, focus and overlays share the theme. The [installation guide](/docs/export) covers runtime dependencies and React/Next.js setup. This import is the entry point, not a complete integration example. Supply the required props and connect callbacks to your application. The full ZIP includes `examples/blocks-preview.tsx` with the populated preview and local sample callbacks; adapt those examples to your product. ```tsx import { ApiKeysBlock } from './components/blocks/application'; // See Source and props below for the complete typed interface. ``` ## Design system This block consumes your semantic colors, spacing, typography and shape tokens. Import the compiled styles and your theme once as described in [Export](/docs/export). Icons use Lucide React. Install `lucide-react@1.47.0` alongside React and Base UI. Dependencies: [Sidebar](/docs/components/sidebar), [Avatar](/docs/components/avatar), [Badge](/docs/components/badge), [Breadcrumb](/docs/components/breadcrumb), [Button](/docs/components/button), [Card](/docs/components/card), [Dialog](/docs/components/dialog), [Dropdown](/docs/components/dropdown), [Field](/docs/components/field), [Input](/docs/components/input), [Progress](/docs/components/progress), [Switch](/docs/components/switch), [Tabs](/docs/components/tabs), [Textarea](/docs/components/textarea), [Alert](/docs/components/alert). ## Behavior and accessibility - Provide meaningful labels for interactive controls. - Connect action callbacks to your application logic. - Verify keyboard navigation and contrast in your application. Status: **experimental** during early access. Sample previews do not send emails, process payments or upload files to a service. ## Source and props This is the exported source, using the same implementation as the editor. The complete source group is included below; related blocks share it to avoid duplicating behavior. ```tsx "use client"; import { useState, type ComponentProps, type ReactNode } from "react"; import { ArrowUpRight, Bell, Building2, CheckCheck, ChevronRight, CreditCard, FileText, KeyRound, Layers2, LayoutGrid, Plus, Search, ShieldCheck, Trash2, UserRound, UserRoundPlus, UsersRound, } from "lucide-react"; import { Sidebar, Avatar, Badge, Breadcrumb, Button, Card, Dialog, Dropdown, Field, Input, Progress, Switch, Tabs, Textarea, } from '../ui'; import { ActionForm, type FormAction } from "./common"; function WorkspaceHeading({ eyebrow, title, description, action, }: { eyebrow: string; title: string; description?: string; action?: ReactNode; }) { return (
{eyebrow}

{title}

{description &&

{description}

}
{action &&
{action}
}
); } export function AppSidebarBlock({ workspace, items, accountName, }: { workspace: string; items: ComponentProps["items"]; accountName: string; }) { return (
{workspace} Workspace } items={items.map((item) => ({ ...item, icon: item.icon ??
); } export function AppHeaderBlock({ breadcrumbs, accountName, onSearch, onSignOut, }: { breadcrumbs: ComponentProps["items"]; accountName: string; onSearch: () => void; onSignOut: () => void; }) { return (
); } export function ProfileBlock({ name, email, bio = "", onSave, }: { name: string; email: string; bio?: string; onSave: FormAction; }) { return (
{name} {email}