mdxui

Component Hierarchy

The complete hierarchy of components from Business to primitives

Component Hierarchy

Business Hierarchy

Business (or Startup extends Business)
├── Site (public/marketing)
│   └── Site → Page → Section → Component
└── App (authenticated/dashboard)
    └── App → View → Panel → Component

Inheritance Model

Components can be defined at any level of the hierarchy. When a Business has certain capabilities (like an API), it automatically gets corresponding components:

Business with <API/>
├── Site gets:
│   ├── LandingPage
│   ├── Docs
│   ├── API (reference)
│   ├── SDK (downloads)
│   └── Blog
└── App gets:
    └── DeveloperDashboard
        ├── Overview
        ├── Keys
        ├── Webhooks
        ├── Requests (usage)
        └── Logs

Site Hierarchy

Site → Page → Section → Component

Level 1: Site

The root container. Provides theme, layout shell, and global context.

ComponentDescriptionPayload Collection
<Site>Root wrapper with theme/providerssites

Level 2: Page

Full-page layouts that compose sections.

ComponentDescriptionPayload Collection
<LandingPage>Homepage with hero, features, etc.pages (type: landing)
<Page>Generic content pagepages
<BlogPage>Blog listing pageblogs
<BlogPostPage>Single blog postposts
<DocsPage>Documentation pagedocs
<APIPage>API reference pageapis
<SDKPage>SDK documentationsdks
<PricingPage>Pricing pageprices
<ContactPage>Contact/demo request-
<LegalPage>Terms, privacy, etc.pages (type: legal)

Level 3: Section

Page sections that compose components.

ComponentDescriptionAuto-wires to
<Hero>Hero section with CTA-
<Features>Features grid/bentofeatures
<Pricing>Pricing tiersprices
<Testimonials>Customer quotes-
<FAQ>FAQ accordion-
<CTA>Call-to-action banner-
<Stats>Statistics/metrics-
<Team>Team members-
<Logos>Customer/partner logos-
<Comparison>Competitor comparisoncompetitors
<Changelog>Release notes-

Level 4: Component

Primitive UI components (from @mdxui/primitives).


App Hierarchy

App → View → Panel → Component

Level 1: App

The root container. Provides auth, theme, and global context.

ComponentDescriptionPayload Collection
<App>Root wrapper with auth/providersapps

Level 2: View

Full-page views (routes) within the app shell.

ComponentDescriptionAuto-wires to
<Dashboard>Main dashboard/overview-
<SettingsView>Settings page shell-
<TeamView>Team managementmembers
<BillingView>Billing managementsubscriptions
<KeysView>API key managementapiKeys
<WebhooksView>Webhook managementwebhooks
<RequestsView>Usage/request logsusageRecords
<DatabaseView>Database explorervaries
<IntegrationsView>Integration managementintegrations
<VaultView>Secrets management-

Level 3: Panel

Panels within views (sidebars, detail panels, etc.)

ComponentDescription
<Sidebar>Navigation sidebar
<Header>Top header bar
<DetailPanel>Side detail panel
<ActivityPanel>Activity feed
<FilterPanel>Filter controls

Level 4: Component

Primitive UI components (from @mdxui/primitives).


Widgets

Widgets are Views or Panels rendered in overlay contexts:

WidgetContextDescription
<SearchBox>ModalGlobal search
<ChatBox>SlideoverChat interface
<Editor>Slideover/ModalMDX editor
<CommandPalette>ModalCommand palette
<Notifications>PopupNotification center

Widget Contexts

type WidgetContext = 'modal' | 'slideover' | 'popup' | 'inline'

interface WidgetProps {
  context?: WidgetContext
  trigger?: ReactNode  // What opens the widget
  open?: boolean       // Controlled state
  onOpenChange?: (open: boolean) => void
}

Component Type Registry

Every component at every level can have a type that determines its behavior:

// Site types determine default pages/sections
type SiteType =
  | 'marketing'      // LandingPage, Features, Pricing, Blog
  | 'documentation'  // Docs, API Reference, SDK
  | 'blog'          // Blog, Posts
  | 'directory'     // Listings, Search

// App types determine default views
type AppType =
  | 'dashboard'     // Overview, Analytics
  | 'developer'     // Keys, Webhooks, Requests, Logs
  | 'admin'         // Users, Settings, Database
  | 'saas'          // Dashboard + Billing + Team

Payload Collection Mapping

LevelComponentCollectionKey Fields
Business<Business>businessesname, org
Business<Startup>startupsname, stage, business
Site<Site>sitesname, template, domains
Page<Page>pagesname, slug, site, template
Page<BlogPage>blogsname, site
Page<DocsPage>docsname, project
App<App>appsname, template, apis, sdks
Feature<API>apisname, slug, domain, business
Feature<SDK>sdksname, api, language

Next Steps

  1. Define exact props for each component level
  2. Map existing UI components to this hierarchy
  3. Create missing components
  4. Implement auto-wiring logic in workers

On this page