The top of a contact or company record: who it is, where it stands, who owns it, and the three things you do first (email, call, note), with the key facts one glance below.
On this page
Used for
- Contact record
- Company record
- Account page
- Lead drawer
- Deal side panel
Examples
Record
Too many facts
Installation
npx knowns-ui@latest add record-headerFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Record header from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/record-header
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add record-header
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/avatar.tsx
- components/ui/knowns/badge.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/tag.tsx
- components/ui/knowns/blocks/crm/record-header.tsx
- components/ui/knowns/blocks/crm/record-header-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/record-header, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "record-header" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- name
string- The contact or company name. Used for the initials and the heading.
- kind
"contact"|"company"- Default
"contact" - A company gets a square avatar with one initial and shows `line` instead of role and company.
- role / company
string- Joined as Role at Company under the name.
- line
string- Replaces the line under the name.
- image
string- A photo or logo URL. Initials show without it or if it fails to load.
- stage
{ label, tone? }- A badge beside the name. tone is a Badge tone, default accent.
- owner
{ name, src? }- Who owns the record. Shown first in the facts row.
- tags
string[]- Small tags under the line.
- email / phone
string- Draw the Email and Call buttons as mailto: and tel: links. An invalid value draws no button.
- onNote
() => void- Draws the Note button and calls it on click.
- actions
ReactNode- Extra buttons after the quick actions.
- facts / maxFacts
{ label, value, href? }[] / number- Default
- / 5 - The key facts row. href is followed only if it is http, https, mailto, tel or a path on the site.
- as
"h1"|"h2"|"h3"- Default
"h1" - Heading level of the name.
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | - | The contact or company name. Used for the initials and the heading. |
| kind | "contact" | "company" | "contact" | A company gets a square avatar with one initial and shows `line` instead of role and company. |
| role / company | string | - | Joined as Role at Company under the name. |
| line | string | - | Replaces the line under the name. |
| image | string | - | A photo or logo URL. Initials show without it or if it fails to load. |
| stage | { label, tone? } | - | A badge beside the name. tone is a Badge tone, default accent. |
| owner | { name, src? } | - | Who owns the record. Shown first in the facts row. |
| tags | string[] | - | Small tags under the line. |
| email / phone | string | - | Draw the Email and Call buttons as mailto: and tel: links. An invalid value draws no button. |
| onNote | () => void | - | Draws the Note button and calls it on click. |
| actions | ReactNode | - | Extra buttons after the quick actions. |
| facts / maxFacts | { label, value, href? }[] / number | - / 5 | The key facts row. href is followed only if it is http, https, mailto, tel or a path on the site. |
| as | "h1" | "h2" | "h3" | "h1" | Heading level of the name. |
What it handles
- 01Shows who or what the record is: a photo, logo or initials, the name, and a line under it (a role at a company, or an industry and city).
- 02Puts the stage next to the name as a badge, and the tags under the line.
- 03Offers the quick actions: Email and Call are links that open the mail or phone app, Note calls your composer. A button is drawn only for a valid address or number.
- 04Closes with a row of key facts, the owner first, such as last touch, open deal and source. Past the limit the rest sit behind a +N more tooltip.
- 05Stacks on a phone: the actions go under the name and the facts take two columns.
States
- No picture
- Initials in the avatar (one letter for a company)
- none
- No email or phone
- The Email or Call button is not drawn
- none
- Facts over the limit
- The extra facts move into a +N more tooltip
- 120ms fade, ease out
- Hover and focus on actions
- Standard button states
- 120ms, ease out
- Reduced motion
- Nothing moves in this block
- 0ms
| State | What moves | Timing |
|---|---|---|
| No picture | Initials in the avatar (one letter for a company) | none |
| No email or phone | The Email or Call button is not drawn | none |
| Facts over the limit | The extra facts move into a +N more tooltip | 120ms fade, ease out |
| Hover and focus on actions | Standard button states | 120ms, ease out |
| Reduced motion | Nothing moves in this block | 0ms |
Works with
When to use
When to use
- The top of a contact or company page in a CRM or an account view.
- The header of a side panel that opens when a row is clicked.
When not to use
- A person in a list or a comment: use Avatar.
- A page title with breadcrumbs and no record: use Page Header.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Record Header to my app and wire it to my own data.
- I need the top of a contact or company page in a CRM or an account view. Set that up with the Knowns UI Record Header.
- Which Record Header props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "record-header" }) and search_docs({ query: "record header" }).