Build an Interactive Team Org Chart One-Pager with Contact Cards in HTML

Get a single HTML file with an expandable SVG org chart, department color coding, clickable contact cards and a search box that highlights matching people.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
You are a senior front-end developer and information designer. Build "Fernhill Studio Team Map", a one-page org chart for a fictional 19-person product studio, as a single self-contained HTML file. Show the team as an expandable SVG tree with the CEO at the top, four department heads below, then their reports, joined by elbow connector lines for reporting lines. Each node shows an initials avatar, name and role, color-coded by department: Leadership, Product, Engineering, Design, Operations.

Rules:
1. Clicking a node, or pressing Enter on it, opens a contact card panel with email, phone, location, reports-to, direct reports and an Ask me about line. Names in the card are buttons that navigate to that person.
2. Nodes with reports get a round toggle showing a minus sign, or plus and the hidden headcount. Add Expand all and Collapse all buttons, and start with two teams collapsed.
3. A search box matches name, role, department or city. Matches get a warm highlight and the rest dim. Collapsed branches open, and a live status line counts the matches. Enter jumps to the first match and Escape clears.
4. Use an indented tree that fits 360 to 1280px. Put the card beside the chart on wide screens and below it on narrow ones. Truncate long text cleanly.
5. Use a warm off-white page, five muted department colors, a header with headcount stats and a color legend. Use no external assets, storage or network.
6. Make every control keyboard-focusable with visible focus rings, and respect prefers-reduced-motion.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Fernhill Studio Team Map, an interactive org chart one-pager.

The page shows a 19-person studio as an indented SVG tree. Each person has a color-coded avatar and connector lines run to their manager. Click anyone, or press Tab then Enter, to open their contact card. Use the round +/− toggles or Expand all to open teams. Try typing Lisbon or engineer in search: matching people glow, everyone else dims and hidden teams open automatically.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • An indented tree layout avoids wide top-down charts that break on phones, so the chart fits any width from 360 to 1280px.
  • Giving a fixed fictional roster, departments and colors means the model writes real sample data instead of placeholders.
  • Spelling out the search behavior (highlight, dim, auto-expand, live count) gets a filter that actually helps you find people.

Paste into ChatGPT, Claude or Gemini. Save the code as team-map.html and open it in a browser, or use the chat's preview or canvas. To use your own team, ask the model to swap in your names and roles.

Common edits

  • Replace the roster with your own team, keeping the same fields: name, manager, role, department, city and topics people can be asked about.
  • Change the department colors or add a sixth department, then ask for a print stylesheet that expands every team before printing.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Infographics