import { ChatGreeting } from "@elabs-ai/components-ai";npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-aiPrompt for your coding agent
Paste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.
Add the brand-ui ChatGreeting component (from @elabs-ai/components-ai) to this project. 1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`. 2. Look ChatGreeting up before writing code: `npx -y @elabs-ai/components-cli docs ChatGreeting` prints its real props, variants, what it pairs with and what to avoid. 3. If @elabs-ai/components-ai is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-ai` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-ai`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`. 4. Use it here: [the screen or file, and what it should show] 5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop. 6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.
Avoid
- Reaching for it as a status message — ConversationEmptyState is the 'no messages yet' panel; this is the display-scale greeting anatomy.
- Carrying the accent on colour alone — the shipped accent pairs the hue with weight + an underline precisely because a monochrome theme's --primary is indistinguishable from the headline ink (WCAG 1.4.1).
- Leaving level={1} when the route already renders its own h1 — Heading decouples level from size, so raise the level and keep the display rung.
- Keeping the orb on inside a dense embedded panel — it is a 40-unit blur sized for a full first-run scene.
Works with
Examples
No Orb
Dense/embedded use — no glow behind the headline.
Long Content
A long name and a two-line accent phrase — `text-balance` keeps the headline readable.
Accent Only
`accent` alone, with no `subtitle` line — the second line must not be dropped.
Heading Level 2
A route that already owns the page's `<h1>` — pass `level={2}` to keep a single, hierarchical outline.
With Composer
The real first-run chat state: greeting above the standard Composer.
API
ChatGreeting
| Prop | Type | Description |
|---|---|---|
titlerequired | ReactNode | Primary line, e.g. "Good morning, Avery". |
subtitle | ReactNode | Second line, rendered under `title` inside the same heading. Independent of `accent` — either may be passed alone. |
accent | ReactNode | Phrase rendered in `text-primary-text` with a bold underline, appended after `subtitle` (or alone). The underline + weight is a NON-hue channel deliberately layered on top of the color — a monochrome theme's `--primary` can be a near-white "pen" by design, in which case the accent colour alone is indistinguishable from the surrounding `--foreground` headline text. The underline/weight keep the phrase legible as an accent in EVERY theme, not only the two where hue alone would carry it. |
orb | boolean | Soft primary glow behind the headline. Default `true`; `false` for dense/embedded use. |
level | HeadingLevel | Semantic heading level for `title`. Default `1` (a chat empty state is typically the only heading on the page). Override to `2`+ when ChatGreeting sits inside a page or route that already renders its own `<h1>` — `Heading` decouples `level` from `size`, so the visual display-scale rung stays put regardless of the level chosen. |
Theming
The tokens each state resolves to. Change the token and every theme follows.
| State | Token |
|---|---|
| orb | an aria-hidden bg-primary/15 blur, opt out with orb={false} for dense/embedded use |
| accent | the accent phrase is text-primary-text (TEXT rung, #399) plus bold + underline — the non-hue channel that keeps it legible in a theme whose --primary is near-white |