Skip to content

docs: add component anatomy explorer for all compound components#472

Open
MaxLee-dev wants to merge 5 commits intodocs-component-analyzerfrom
add-component-anatomy
Open

docs: add component anatomy explorer for all compound components#472
MaxLee-dev wants to merge 5 commits intodocs-component-analyzerfrom
add-component-anatomy

Conversation

@MaxLee-dev
Copy link
Copy Markdown
Contributor

@MaxLee-dev MaxLee-dev commented Feb 6, 2026

Related Issues

Description of Changes

An interactive Anatomy Explorer has been implemented for all compound pattern components, and an Anatomy section has been added to each component's documentation.

1. Component Explorer System Implementation

  • ComponentExplorer: Interactive exploration UI combining iframe-based component previews with a left-hand part list
  • AnatomyPanel: Side panel displaying the component's structural parts
  • HighlightOverlay: Overlay highlighting elements within the iframe on hover (clsx styling, Vapor UI design tokens applied)
  • PartButton: Interactive buttons representing individual parts
  • PostMessage-based communication between iframe and parent
  • Fetch error handling and retry functionality

2. Automated Anatomy Data Generation

  • generate:anatomy script automatically generates anatomy JSON from index.parts.ts
  • Anatomy JSON data generation completed for 25 compound components

3. Add Anatomy Examples for 25 Components

Group Component
Simple Display Grid, Avatar
Content Containers Card, Callout, Collapsible, Breadcrumb
Form Controls Switch, Checkbox, Radio, RadioGroup, InputGroup, Field
Tabs/Table Pagination, Tabs, Table
Popup (Basic) Tooltip, FloatingBar, Popover, Sheet, NavigationMenu
Popup (Complex) Select, MultiSelect, Toast, Menu, Dialog

4. MDX Documentation Updates

  • Added Anatomy section to 24 component MDX files + 1 layout MDX (Grid)
  • Placed <componentexplorer> before the Props Table section

Checklist

  • The PR title follows the Conventional Commits convention.
  • I have added tests for my changes.
  • I have updated the Storybook or relevant documentation.
  • I have added a changeset for this change.
  • I have performed a self-code review.
  • I have followed the project's coding conventions and component patterns.

Summary by CodeRabbit

  • Documentation
    • Added interactive "Anatomy" sections across 25+ component documentation pages, enabling users to explore and understand component structural parts through visual, hover-based highlighting of individual elements.

Add interactive anatomy examples with ComponentExplorer for 24 compound
pattern components. Each example marks all component parts with data-part
attributes for hover-based highlighting in the documentation site.

Components added:
- Simple: Grid, Avatar
- Containers: Card, Callout, Collapsible, Breadcrumb
- Form Controls: Switch, Checkbox, Radio, RadioGroup, InputGroup, Field
- Tabs/Table: Pagination, Tabs, Table
- Popup: Tooltip, FloatingBar, Popover, Sheet, NavigationMenu
- Complex: Select, MultiSelect, Toast, Menu

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vapor-ui Ready Ready Preview, Comment Mar 25, 2026 5:57am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: 40d6a73

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MaxLee-dev MaxLee-dev changed the base branch from main to docs-component-analyzer February 6, 2026 05:52
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @MaxLee-dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 컴포넌트 문서의 사용자 경험을 혁신적으로 개선하기 위해 인터랙티브 Anatomy Explorer를 도입합니다. 개발자와 디자이너는 이제 각 컴포넌트의 내부 구조와 파트를 시각적으로 탐색하고 이해할 수 있어, 컴포넌트 사용 및 커스터마이징이 훨씬 용이해질 것입니다. 이는 문서의 가독성과 유용성을 크게 향상시키는 중요한 기능 추가입니다.

Highlights

  • 인터랙티브 컴포넌트 Anatomy Explorer 시스템 구현: 컴포넌트의 구조를 시각적으로 탐색할 수 있는 ComponentExplorer 시스템이 추가되었습니다. 이는 iframe 기반 미리보기, 컴포넌트 파트 목록, 호버 시 하이라이트 오버레이(HighlightOverlay), 그리고 iframe과 부모 간의 PostMessage 통신을 포함합니다. 또한, 데이터 로딩을 위한 fetch 에러 핸들링 및 재시도 기능도 구현되었습니다.
  • Anatomy 데이터 자동 생성 및 통합: generate:anatomy 스크립트를 통해 25개 compound 컴포넌트의 index.parts.ts 파일에서 anatomy JSON 데이터가 자동으로 생성됩니다. 이 데이터는 각 컴포넌트의 구조적 파트 정보를 담고 있으며, Explorer에서 활용됩니다.
  • 25개 컴포넌트 문서에 Anatomy 섹션 추가: Avatar, Breadcrumb, Card, Callout, Checkbox, Collapsible, Dialog, Field, FloatingBar, InputGroup, Menu, MultiSelect, NavigationMenu, Pagination, Popover, Radio, Select, Sheet, Switch, Table, Tabs, Toast, Tooltip, Grid 컴포넌트의 MDX 문서에 새로운 'Anatomy' 섹션이 추가되었으며, 여기에 <ComponentExplorer> 컴포넌트가 배치되어 인터랙티브 탐색 기능을 제공합니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/website/content/docs/components/*.mdx
    • 각 컴포넌트 문서에 'Anatomy' 섹션과 <ComponentExplorer> 컴포넌트 추가
  • apps/website/content/docs/layout/grid.mdx
    • Grid 컴포넌트 문서에 'Anatomy' 섹션과 <ComponentExplorer> 컴포넌트 추가
  • apps/website/package.json
    • generate:anatomy 스크립트 추가
  • apps/website/public/components/anatomy/*.json
    • 각 컴포넌트의 Anatomy 데이터를 담은 JSON 파일 25개 신규 추가
  • apps/website/scripts/generate-anatomy.mjs
    • 컴포넌트 Anatomy JSON 데이터를 자동으로 생성하는 스크립트 신규 추가
  • apps/website/src/app/preview/[component]/page.tsx
    • 미리보기 페이지에서 explorer 검색 파라미터를 받아 PreviewWrapper에 전달하도록 수정
  • apps/website/src/app/preview/[component]/preview-wrapper.tsx
    • HighlightOverlay 컴포넌트 임포트 및 explorer prop에 따라 조건부 렌더링 로직 추가
    • 미리보기 컨테이너에 fixed inset-0 flex items-center justify-center p-4 스타일 추가
  • apps/website/src/app/preview/layout.tsx
    • HTML 및 Body 태그에 h-full 클래스 추가 및 Body에 미리보기 중앙 정렬을 위한 스타일 추가
  • apps/website/src/components/component-explorer/anatomy-panel.tsx
    • 컴포넌트 파트 목록을 표시하고 호버 이벤트를 처리하는 AnatomyPanel 컴포넌트 신규 추가
  • apps/website/src/components/component-explorer/component-explorer.tsx
    • 인터랙티브 컴포넌트 탐색기 UI를 구현하는 ComponentExplorer 컴포넌트 신규 추가
    • Anatomy 데이터 로딩, iframe 통신, 에러 처리 및 재시도 로직 포함
  • apps/website/src/components/component-explorer/iframe/highlight-overlay.tsx
    • iframe 내에서 컴포넌트 파트를 시각적으로 하이라이트하는 HighlightOverlay 컴포넌트 신규 추가
  • apps/website/src/components/component-explorer/iframe/use-highlight-receiver.ts
    • iframe 내에서 부모로부터 하이라이트 메시지를 수신하는 훅 신규 추가
  • apps/website/src/components/component-explorer/index.ts
    • ComponentExplorer 및 관련 타입 내보내기 추가
  • apps/website/src/components/component-explorer/part-button.tsx
    • 개별 컴포넌트 파트를 나타내는 PartButton 컴포넌트 신규 추가
  • apps/website/src/components/component-explorer/types.ts
    • Explorer 메시지 타입 및 Anatomy 데이터 구조 정의 신규 추가
  • apps/website/src/components/component-explorer/use-explorer-communication.ts
    • 부모 컴포넌트에서 iframe으로 하이라이트 메시지를 전송하는 훅 신규 추가
  • apps/website/src/components/demo/examples//anatomy-.tsx
    • 각 컴포넌트의 Anatomy Explorer를 위한 데모 예제 파일 신규 추가
  • apps/website/src/mdx-components.tsx
    • ComponentExplorer 컴포넌트를 MDX에서 사용할 수 있도록 임포트 및 노출
Activity
  • MaxLee-dev 님이 모든 compound pattern 컴포넌트에 대한 인터랙티브 Anatomy Explorer를 구현하고 각 컴포넌트 문서에 Anatomy 섹션을 추가했습니다.
  • MaxLee-dev 님이 Component Explorer 시스템 (iframe 기반 미리보기, 파트 목록, 하이라이트 오버레이, PostMessage 통신, fetch 에러 핸들링)을 구현했습니다.
  • MaxLee-dev 님이 generate:anatomy 스크립트를 개발하여 25개 compound 컴포넌트의 anatomy JSON 데이터를 자동 생성했습니다.
  • MaxLee-dev 님이 25개 컴포넌트의 MDX 문서에 Anatomy 예제를 추가하고 <ComponentExplorer>를 배치했습니다.
  • MaxLee-dev 님이 Conventional Commits 컨벤션을 따르는 PR 제목을 작성했습니다.
  • MaxLee-dev 님이 자체 코드 리뷰를 수행했습니다.
  • MaxLee-dev 님이 프로젝트의 코딩 컨벤션 및 컴포넌트 패턴을 준수했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 복합 컴포넌트(compound components)를 위한 대화형 Anatomy Explorer를 도입하여 문서의 완성도를 크게 높였습니다. 전반적인 구현은 훌륭하며, 자동화된 데이터 생성 스크립트와 다수의 컴포넌트에 대한 문서 업데이트가 인상적입니다. 다만, 일부 새로운 anatomy 예제 파일에서 data-part 속성이 누락되어 Explorer가 특정 파트를 하이라이트하지 못하는 문제가 발견되었습니다. 각 파일에 구체적인 수정 제안을 포함한 리뷰 코멘트를 남겼으니 확인 부탁드립니다. 이 리뷰는 저장소 스타일 가이드에 따라 작성되었습니다.

Copy link
Copy Markdown
Contributor

@noahchoii noahchoii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work! Explorer looks really great! I've left a few questions and points for discussion below—please take a look!


  1. The reason we initially proposed adding Anatomy was to clearly show the hierarchical structure between component elements, but that part seems to be missing!

  2. Elements like PortalPrimitive and PopupPrimitive don't seem to be navigating properly—please check this!

  3. For rendering states like the open state of Overlay elements or the checked state of checkboxes, adjusting the initial value to true or similar might be beneficial!

  4. Clicking the left button doesn't seem to trigger any specific event, but the active style remains, potentially creating an expectation among users that another action will occur. How about leaving only the hover style, or using a different element?

  5. The role of the left sidebar is set to navigation. The navigation role is a collection of links used for navigating a website. Personally, I feel this doesn't fit this component. Is there a specific reason you determined it should be the navigation role?

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a73c492b-aba6-4739-a11c-ea6349fc03cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds "Anatomy" sections to 23 component documentation pages with interactive ComponentExplorer components, alongside 23 corresponding example React components that render the anatomy structure for each component type.

Changes

Cohort / File(s) Summary
Component Documentation - Anatomy Sections
apps/website/content/docs/components/(components)/{avatar,breadcrumb,callout,card,checkbox,collapsible,field,floating-bar,input-group,menu,multi-select,navigation-menu,pagination,popover,radio,select,sheet,switch,tabs,toast,tooltip}.mdx, apps/website/content/docs/components/(layouts)/grid.mdx
Added "Anatomy" sections to 23 component documentation pages with descriptive text and embedded ComponentExplorer instances referencing corresponding anatomy examples.
Anatomy Example Components
apps/website/src/components/demo/examples/{avatar,breadcrumb,callout,card,checkbox,collapsible,field,floating-bar,input-group,menu,multi-select,navigation-menu,pagination,popover,radio,select,sheet,switch,table,tabs,toast,tooltip,grid}/anatomy-*.tsx
Added 23 new React component examples that render the structural anatomy of each component using @vapor-ui/core primitives with data-part attributes for interactive highlighting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested labels

scope: docs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: add component anatomy explorer for all compound components' directly and clearly describes the main change—adding an anatomy explorer feature and documentation sections to component docs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-component-anatomy

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (5)
apps/website/src/components/demo/examples/input-group/anatomy-input-group.tsx (1)

7-10: TextInputdata-part 속성 추가 고려

다른 anatomy 예제들의 패턴을 보면, 시각화 대상이 되는 모든 컴포넌트에 data-part 속성을 부여하고 있습니다. TextInput은 InputGroup의 핵심 구성 요소이므로, anatomy 탐색기에서 하이라이팅되도록 data-part 속성을 추가하는 것이 좋을 것 같습니다.

♻️ 제안된 수정 사항
     <InputGroup.Root data-part="Root">
-        <TextInput placeholder="메시지를 입력하세요..." maxLength={100} width="100%" />
+        <TextInput data-part="TextInput" placeholder="메시지를 입력하세요..." maxLength={100} width="100%" />
         <InputGroup.Counter data-part="Counter" />
     </InputGroup.Root>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/website/src/components/demo/examples/input-group/anatomy-input-group.tsx`
around lines 7 - 10, Add a data-part attribute to the TextInput inside the
InputGroup so it is included in the anatomy highlight; update the JSX under
InputGroup.Root (where TextInput is rendered alongside InputGroup.Counter) to
include a suitable data-part (e.g., "Input" or "TextInput") on the TextInput
component so the anatomy explorer can target it along with InputGroup.Root and
InputGroup.Counter.
apps/website/src/components/demo/examples/pagination/anatomy-pagination.tsx (1)

1-11: 'use client' 지시어 누락 확인 필요

Pagination 컴포넌트는 페이지 이동을 위한 인터랙션이 포함된 컴포넌트입니다. 클라이언트 사이드 동작이 필요할 수 있으므로 'use client' 지시어 추가를 고려해 주세요.

♻️ 제안된 수정 사항
+'use client';
+
 import { Pagination } from '@vapor-ui/core';
 
 export default function AnatomyPagination() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/website/src/components/demo/examples/pagination/anatomy-pagination.tsx`
around lines 1 - 11, This file exports a client-interactive React component
AnatomyPagination using Pagination.* interactive subcomponents; add the 'use
client' directive as the very first line of the file (before the import) so the
component and Pagination.Root/Previous/Items/Next run on the client; update the
top of
apps/website/src/components/demo/examples/pagination/anatomy-pagination.tsx
accordingly to ensure client-side interactivity for the AnatomyPagination
component.
apps/website/src/components/demo/examples/switch/anatomy-switch.tsx (1)

1-9: 'use client' 지시어 누락 확인 필요

Switch 컴포넌트는 defaultChecked 상태를 관리하는 인터랙티브 컴포넌트입니다. 다른 anatomy 예제들(예: anatomy-collapsible.tsx, anatomy-input-group.tsx)과 일관성을 유지하기 위해 'use client' 지시어 추가를 권장합니다.

♻️ 제안된 수정 사항
+'use client';
+
 import { Switch } from '@vapor-ui/core';
 
 export default function AnatomySwitch() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/website/src/components/demo/examples/switch/anatomy-switch.tsx` around
lines 1 - 9, The AnatomySwitch component is missing the 'use client' directive
required for interactive, stateful components; add a 'use client' directive as
the very first line of the file so AnatomySwitch (the exported function) and its
usage of Switch.Root and Switch.ThumbPrimitive with defaultChecked run on the
client, matching other anatomy examples like anatomy-collapsible and
anatomy-input-group.
apps/website/src/components/demo/examples/radio/anatomy-radio.tsx (1)

1-9: 'use client' 지시어 누락 확인 필요

다른 인터랙티브 컴포넌트 예제(예: anatomy-switch.tsx, anatomy-collapsible.tsx)에서는 'use client' 지시어를 사용하고 있습니다. Radio 컴포넌트도 상태 관리가 필요한 인터랙티브 컴포넌트이므로 일관성을 위해 'use client' 지시어 추가를 고려해 주세요.

♻️ 제안된 수정 사항
+'use client';
+
 import { Radio } from '@vapor-ui/core';
 
 export default function AnatomyRadio() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/website/src/components/demo/examples/radio/anatomy-radio.tsx` around
lines 1 - 9, Add the missing 'use client' directive as the very first line of
this file so the AnatomyRadio component runs as a client component; update the
top of the file containing the AnatomyRadio function (which renders Radio.Root
and Radio.IndicatorPrimitive) to include 'use client' before any imports/exports
to ensure the interactive Radio component is treated consistently with other
examples.
apps/website/src/components/demo/examples/select/anatomy-select.tsx (1)

1-39: 'use client' directive 추가 고려

Select 컴포넌트는 열기/닫기 상호작용이 필요한 클라이언트 컴포넌트입니다. 다른 인터랙티브 anatomy 예제(FloatingBar, Sheet, Tooltip 등)와 일관성을 위해 'use client' directive 추가를 권장합니다.

♻️ 제안된 수정
+'use client';
+
 import { Select } from '@vapor-ui/core';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/website/src/components/demo/examples/select/anatomy-select.tsx` around
lines 1 - 39, This file exports the interactive AnatomySelect component that
uses Select.Root / Select.Trigger and other Select primitives which require
client-side interactivity; add the 'use client' directive as the first line of
the file so AnatomySelect and its
Select.Trigger/Select.PortalPrimitive/Select.PopupPrimitive behavior runs as a
client component.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/website/src/components/demo/examples/checkbox/anatomy-checkbox.tsx`:
- Around line 5-6: The Checkbox example is missing an accessible name; update
the Checkbox.Root usage (and/or add a visible label component) to provide an
accessible name by adding an aria-label or by associating it with a text label
(e.g., render a Checkbox.Label or a <label> tied to Checkbox.Root's id) so
screen readers can announce the control; ensure the change applies to the
instance that renders Checkbox.Root and that Checkbox.IndicatorPrimitive remains
as the visual indicator only.

In `@apps/website/src/components/demo/examples/menu/anatomy-menu.tsx`:
- Around line 16-48: Some Menu elements are missing consistent data-part
annotations which breaks hover highlighting; update the JSX to add data-part
attributes for the missing elements: add data-part="GroupLabel" to the
Menu.GroupLabel instance (the "File" label), add data-part="Item" to the "Open
File" Menu.Item, ensure the Menu.CheckboxItemPrimitive and its inner
Menu.CheckboxItemIndicatorPrimitive / Menu.CheckboxItem each have data-part
attributes (for the Auto Save entry), add data-part on the
Menu.RadioItemPrimitive/value="dark" and its inner Menu.RadioItem for the "Dark"
option, and add data-part attributes to Menu.SubmenuTriggerItem and the
Menu.SubmenuPopup children ("PDF", "CSV") so all instances (Menu.GroupLabel,
Menu.Item, Menu.CheckboxItemPrimitive, Menu.CheckboxItemIndicatorPrimitive,
Menu.CheckboxItem, Menu.RadioItemPrimitive, Menu.RadioItem,
Menu.SubmenuTriggerItem, Menu.SubmenuPopup) are annotated consistently.

In `@apps/website/src/components/demo/examples/tabs/anatomy-tabs.tsx`:
- Around line 8-26: Some Tabs parts are missing the data-part attributes causing
inconsistent Anatomy Explorer highlighting; add data-part="Button" to the second
Tabs.Button (value="features") and add data-part="Panel" to the second
Tabs.Panel (value="features") so both Tabs.Button and Tabs.Panel instances use
consistent data-part values ("Button" and "Panel") for proper part highlighting.

---

Nitpick comments:
In
`@apps/website/src/components/demo/examples/input-group/anatomy-input-group.tsx`:
- Around line 7-10: Add a data-part attribute to the TextInput inside the
InputGroup so it is included in the anatomy highlight; update the JSX under
InputGroup.Root (where TextInput is rendered alongside InputGroup.Counter) to
include a suitable data-part (e.g., "Input" or "TextInput") on the TextInput
component so the anatomy explorer can target it along with InputGroup.Root and
InputGroup.Counter.

In `@apps/website/src/components/demo/examples/pagination/anatomy-pagination.tsx`:
- Around line 1-11: This file exports a client-interactive React component
AnatomyPagination using Pagination.* interactive subcomponents; add the 'use
client' directive as the very first line of the file (before the import) so the
component and Pagination.Root/Previous/Items/Next run on the client; update the
top of
apps/website/src/components/demo/examples/pagination/anatomy-pagination.tsx
accordingly to ensure client-side interactivity for the AnatomyPagination
component.

In `@apps/website/src/components/demo/examples/radio/anatomy-radio.tsx`:
- Around line 1-9: Add the missing 'use client' directive as the very first line
of this file so the AnatomyRadio component runs as a client component; update
the top of the file containing the AnatomyRadio function (which renders
Radio.Root and Radio.IndicatorPrimitive) to include 'use client' before any
imports/exports to ensure the interactive Radio component is treated
consistently with other examples.

In `@apps/website/src/components/demo/examples/select/anatomy-select.tsx`:
- Around line 1-39: This file exports the interactive AnatomySelect component
that uses Select.Root / Select.Trigger and other Select primitives which require
client-side interactivity; add the 'use client' directive as the first line of
the file so AnatomySelect and its
Select.Trigger/Select.PortalPrimitive/Select.PopupPrimitive behavior runs as a
client component.

In `@apps/website/src/components/demo/examples/switch/anatomy-switch.tsx`:
- Around line 1-9: The AnatomySwitch component is missing the 'use client'
directive required for interactive, stateful components; add a 'use client'
directive as the very first line of the file so AnatomySwitch (the exported
function) and its usage of Switch.Root and Switch.ThumbPrimitive with
defaultChecked run on the client, matching other anatomy examples like
anatomy-collapsible and anatomy-input-group.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 87be65c3-26d0-4df6-b7fb-59951cde2121

📥 Commits

Reviewing files that changed from the base of the PR and between 72731de and c4b44d1.

📒 Files selected for processing (46)
  • apps/website/content/docs/components/(components)/avatar.mdx
  • apps/website/content/docs/components/(components)/breadcrumb.mdx
  • apps/website/content/docs/components/(components)/callout.mdx
  • apps/website/content/docs/components/(components)/card.mdx
  • apps/website/content/docs/components/(components)/checkbox.mdx
  • apps/website/content/docs/components/(components)/collapsible.mdx
  • apps/website/content/docs/components/(components)/field.mdx
  • apps/website/content/docs/components/(components)/floating-bar.mdx
  • apps/website/content/docs/components/(components)/input-group.mdx
  • apps/website/content/docs/components/(components)/menu.mdx
  • apps/website/content/docs/components/(components)/multi-select.mdx
  • apps/website/content/docs/components/(components)/navigation-menu.mdx
  • apps/website/content/docs/components/(components)/pagination.mdx
  • apps/website/content/docs/components/(components)/popover.mdx
  • apps/website/content/docs/components/(components)/radio.mdx
  • apps/website/content/docs/components/(components)/select.mdx
  • apps/website/content/docs/components/(components)/sheet.mdx
  • apps/website/content/docs/components/(components)/switch.mdx
  • apps/website/content/docs/components/(components)/table.mdx
  • apps/website/content/docs/components/(components)/tabs.mdx
  • apps/website/content/docs/components/(components)/toast.mdx
  • apps/website/content/docs/components/(components)/tooltip.mdx
  • apps/website/content/docs/components/(layouts)/grid.mdx
  • apps/website/src/components/demo/examples/avatar/anatomy-avatar.tsx
  • apps/website/src/components/demo/examples/breadcrumb/anatomy-breadcrumb.tsx
  • apps/website/src/components/demo/examples/callout/anatomy-callout.tsx
  • apps/website/src/components/demo/examples/card/anatomy-card.tsx
  • apps/website/src/components/demo/examples/checkbox/anatomy-checkbox.tsx
  • apps/website/src/components/demo/examples/collapsible/anatomy-collapsible.tsx
  • apps/website/src/components/demo/examples/field/anatomy-field.tsx
  • apps/website/src/components/demo/examples/floating-bar/anatomy-floating-bar.tsx
  • apps/website/src/components/demo/examples/grid/anatomy-grid.tsx
  • apps/website/src/components/demo/examples/input-group/anatomy-input-group.tsx
  • apps/website/src/components/demo/examples/menu/anatomy-menu.tsx
  • apps/website/src/components/demo/examples/multi-select/anatomy-multi-select.tsx
  • apps/website/src/components/demo/examples/navigation-menu/anatomy-navigation-menu.tsx
  • apps/website/src/components/demo/examples/pagination/anatomy-pagination.tsx
  • apps/website/src/components/demo/examples/popover/anatomy-popover.tsx
  • apps/website/src/components/demo/examples/radio/anatomy-radio.tsx
  • apps/website/src/components/demo/examples/select/anatomy-select.tsx
  • apps/website/src/components/demo/examples/sheet/anatomy-sheet.tsx
  • apps/website/src/components/demo/examples/switch/anatomy-switch.tsx
  • apps/website/src/components/demo/examples/table/anatomy-table.tsx
  • apps/website/src/components/demo/examples/tabs/anatomy-tabs.tsx
  • apps/website/src/components/demo/examples/toast/anatomy-toast.tsx
  • apps/website/src/components/demo/examples/tooltip/anatomy-tooltip.tsx

@MaxLee-dev
Copy link
Copy Markdown
Contributor Author

MaxLee-dev commented Mar 23, 2026

Thanks for your work! Explorer looks really great! I've left a few questions and points for discussion below—please take a look!

@noahchoii

Thanks for the review! Here are my responses to each point.

1. Hierarchical structure

Components like Popup internally render PopupPrimitive, PositionerPrimitive, PortalPrimitive, etc. However, due to the component architecture, when using Popup you can't directly render the internal primitives separately. So rather than showing a tree hierarchy, I intentionally split the panel into Parts / Primitives sections to show where the primitive layer sits. Expressing the hierarchy as a tree view could be discussed as a future improvement.

2. PortalPrimitive / PopupPrimitive navigation

Fixed by updating the examples.

3. Rendering initial state

Agreed. Adjusted initial values so that overlay elements appear in an open state and checkboxes appear checked, making parts immediately visible.

4. Click active style

Clicking a part now sets it to a selected state. The selected part provides visual feedback with a left indicator and primary color.

5. Sidebar role attribute

Changed from role="navigation" to role="listbox" based on your feedback. The part list is a selectable option list rather than a collection of navigation links, so the listbox + option pattern is a better fit. Each option expresses its selection state via aria-selected, and keyboard navigation is supported through a roving tabindex pattern (ArrowUp/Down, Home, End, Escape).

@MaxLee-dev MaxLee-dev requested review from noahchoii and removed request for ZeroChoi2781 March 23, 2026 07:59
@MaxLee-dev
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@noahchoii
Copy link
Copy Markdown
Contributor

@MaxLee-dev

I’ve reviewed the changes, and the component structure is much easier to grasp now! Thank you, Max.

I do have one question, though. I noticed that anatomy components composed of multiple primitives (e.g., Dialog.Popup, Select.Popup) aren't being displayed. Was this intentional? My understanding was that this Component Explorer is meant to show all constituent elements so users can see the difference between a Popup and a combination of PopupPrimitive + PositionerPrimitive + PortalPrimitive. Without the Popup element, I’m concerned users might not fully grasp the distinction between the two approaches. What are your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants