# kui-react v0.1.0 — Full component catalog Generated 2026-07-10T16:33:24.767Z. Machine-readable catalog of every component, theme, design token, and convention in the kui-react library. Consume this from an AI assistant to know what exists, where it lives, and how to use it. ## Layers - **ui** — modules/ui/ — Primitive, locally-stateful components (atoms + molecules). No business logic. Every file starts with 'use client' and imports cn from @/libs/utils/cn. - **app** — modules/app/ — Application-level patterns (organisms, page shells, forms, providers). May own local state and orchestrate ui-layer atoms. - **domain** — modules/domains// — Industry-vertical components that compose ui/ + app/. Each vertical exports a barrel index.ts and a types.ts with Zod schemas. - **theme** — app/theme// — Full multi-page demos wiring domain components into a realistic product experience. layout.tsx is client, page.tsx is server unless it owns state. - **library** — External npm packages featured in the showcase (e.g. kui-viewer). filePath points to the showcase example, not first-party source; the `external` field carries homepage/npm/github links. ## Conventions - **icons** — All icons MUST come from Font Awesome. Named imports only — never the whole set. Apply Tailwind classes via className (e.g. text-primary, w-4 h-4); never use the size prop with raw strings. aria-hidden="true" on decorative icons. - **styling** — Tailwind CSS 4 with CSS-variable design tokens. Use cn() from @/libs/utils/cn for class composition — never raw template literals. Reference token names (bg-primary, text-text-secondary) — never hex. - **types** — Define props inline with a local type. Domain layers use Zod schemas in types.ts. Components export named functions — never default exports (excluding next/dynamic wrappers). - **accessibility** — Use semantic HTML. Apply aria-busy / aria-invalid / aria-describedby / aria-pressed / aria-expanded as relevant. ALWAYS include focus-visible:ring-2 focus-visible:ring-border-focus on interactive elements. Use disabled:opacity-50 disabled:cursor-not-allowed for disabled state. - **fileNaming** — UI/Domain components: PascalCase .tsx. Showcase builders: kebab-case .showcase.tsx. Utilities: camelCase .ts. Domain directories: lowercase. - **pathAlias** — @/ resolves to the project root. Import as: @/modules/ui/, @/modules/app/, @/modules/domains/, @/libs/utils/cn. ## Design tokens | Token | Light value | Purpose | |---|---|---| | `--primary` | `#3b82f6` | Primary actions | | `--primary-hover` | `#2563eb` | Hover state | | `--primary-active` | `#1d4ed8` | Active/pressed | | `--primary-subtle` | `#eff6ff` | Tinted backgrounds | | `--primary-fg` | `#ffffff` | Text on primary | | `--secondary` | `#8b5cf6` | Secondary actions | | `--surface-base` | `#ffffff` | Page background | | `--surface-raised` | `#f9fafb` | Cards | | `--surface-overlay` | `#f3f4f6` | Hover overlays | | `--surface-sunken` | `#e5e7eb` | Inset areas | | `--text-primary` | `#111827` | Body text | | `--text-secondary` | `#6b7280` | Muted text | | `--text-disabled` | `#9ca3af` | Disabled text | | `--text-inverse` | `#ffffff` | Text on dark bg | | `--border` | `#e5e7eb` | Default borders | | `--border-strong` | `#d1d5db` | Emphasized borders | | `--border-focus` | `#3b82f6` | Focus rings | | `--success` | `#22c55e` | Success state | | `--success-subtle` | `#f0fdf4` | Success background | | `--success-fg` | `#14532d` | Text on success | | `--warning` | `#f59e0b` | Warning state | | `--warning-subtle` | `#fffbeb` | Warning background | | `--error` | `#ef4444` | Error/danger state | | `--error-subtle` | `#fef2f2` | Error background | | `--info` | `#06b6d4` | Informational state | | `--info-subtle` | `#ecfeff` | Info background | ## Components — app / App ### AppShell (`app-shell`) - **Layer:** app - **Category:** App - **File:** `modules/app/AppShell.tsx` - **Status:** stable (since 2025-03) - **Description:** Full-screen layout wrapper with logo, sidebar and topbar slots. Sidebar renders as an aside on desktop and opens via a drawer on mobile. - **Design tokens:** --border, --surface-base, --surface-raised **Variants:** *Sidebar + topbar + content* ```tsx const [sidebarCollapsed, setSidebarCollapsed] = useState(false); Acme} compactLogo={A} sidebarCollapsed={sidebarCollapsed} sidebar={ } /> } topbar={
} > {/* page content */}
``` *Sadece topbar (sidebar yok)* ```tsx Acme}>
} > {/* page content */}
``` ### AppSidebar (`app-sidebar`) - **Layer:** app - **Category:** App - **File:** `modules/app/AppSidebar.tsx` - **Status:** stable (since 2025-03) - **Description:** Collapsible side navigation. Accepts navGroups or navItems with a built-in collapse toggle. The searchable prop adds an inline filter and a footer slot can host a user block or any content. - **Design tokens:** --border, --border-focus, --primary, --primary-subtle, --secondary, --surface-overlay, --text-disabled, --text-primary, --text-secondary **Variants:** *Açık (grouped nav + footer)* ```tsx (
{!collapsed &&

Jane Doe

}
)} /> ``` *Arama filtreli* ```tsx ``` *Daraltılmış (icon-only)* ```tsx ``` ### AppTopBar (`app-top-bar`) - **Layer:** app - **Category:** App - **File:** `modules/app/AppTopBar.tsx` - **Status:** stable (since 2025-03) - **Description:** Top bar wrapper passed into AppShell's header slot. The logo slot anchors the left side while children (GlobalSearch, UserMenu, Button, etc.) are arranged in a flex row. **Variants:** *Arama + actions + kullanıcı* ```tsx
``` *Logo + action + kullanıcı* ```tsx Acme}>
``` ### AppNav (`app-nav`) - **Layer:** app - **Category:** App - **File:** `modules/app/AppNav.tsx` - **Status:** stable (since 2025-03) - **Description:** Horizontal navigation bar. Renders inline links on desktop and a hamburger that opens a NavDrawer on mobile. Provides logo, navItems and actions slots. - **Design tokens:** --border, --primary, --primary-subtle, --secondary, --surface-overlay, --surface-raised, --text-primary, --text-secondary **Variants:** *Marketing bar (logo + links + CTA)* ```tsx Acme} navItems={[ { label: 'Home', href: '/', active: true }, { label: 'Products', href: '/products' }, { label: 'Pricing', href: '/pricing' }, ]} > ``` *App bar (links + UserMenu)* ```tsx Dashboard} navItems={[ { label: 'Overview', active: true }, { label: 'Analytics' }, { label: 'Reports' }, ]} > ``` ### NavDrawer (`nav-drawer`) - **Layer:** app - **Category:** App - **File:** `modules/app/NavDrawer.tsx` - **Status:** stable (since 2025-03) - **Description:** Wrapper that wraps any trigger and children inside a drawer. Manages its own open/closed state. Used as AppNav's mobile menu and also works standalone. **Variants:** *Sol nav (standalone)* ```tsx }>Open menu} footer={} > ``` *Sağ drawer (cart panel)* ```tsx 🛒 Cart (3)} > {cartItems.map((item) => (
{item.name}{item.price}
))}
``` ### UserMenu (`user-menu`) - **Layer:** app - **Category:** App - **File:** `modules/app/UserMenu.tsx` - **Status:** stable (since 2025-03) - **Description:** User dropdown opened by a trigger showing avatar, name and role. Accepts a SafeUser prop; the dropdown header shows the name and email. - **Design tokens:** --border, --border-focus, --primary, --secondary, --surface-overlay, --text-disabled, --text-primary, --text-secondary **Variants:** *Varsayılan (isim + e-posta + rol)* ```tsx ``` *Özel items* ```tsx {} }, { label: 'Billing', icon: '💳', onClick: () => {} }, { type: 'separator' }, { label: 'Sign out', icon: '↩️', danger: true, onClick: () => {} }, ]} /> ``` ### GlobalSearch (`global-search`) - **Layer:** app - **Category:** App - **File:** `modules/app/GlobalSearch.tsx` - **Status:** stable (since 2025-04) - **Description:** Command-palette-style global search field. Supports a categorised result list, keyboard navigation and result selection. **Variants:** *Interactive results* ```tsx setSelected(result.label)} /> ``` *Loading state* ```tsx ``` ### AppCommandBar (`app-command-bar`) - **Layer:** app - **Category:** App - **File:** `modules/app/CommandPalette/index.tsx` - **Status:** beta (since 2025-04) - **Description:** Keyboard-first command palette. Opens with ⌘K; an items prop accepts custom commands while a default navigation/actions/recent set is included. **Variants:** *Varsayılan komutlar* ```tsx console.log(item.label)} /> ``` *Özel items + trigger* ```tsx ⌘K}>Search…} onSelect={handleSelect} /> ``` *Fuzzy search + özel gruplar* ```tsx // Try typing "kbd", "asgn" or "rls" to exercise the subsequence matcher. const fuzzyItems = [ { icon: '⌨️', label: 'Open Keyboard Shortcuts', shortcut: '?', category: 'Help', keywords: ['kbd'] }, { icon: '📚', label: 'Browse Documentation', shortcut: 'G H', category: 'Help' }, { icon: '🔔', label: 'Notification Preferences', shortcut: 'G N', category: 'Preferences' }, { icon: '🛠️', label: 'Assign Reviewer to PR-42', shortcut: 'A R', category: 'Workflows', keywords: ['asgn'] }, { icon: '🚀', label: 'Release & Tag v1.4.0', shortcut: 'R T', category: 'Workflows', keywords: ['rls'] }, ]; ``` ### SectionCard (`section-card`) - **Layer:** app - **Category:** App - **File:** `modules/app/SectionCard.tsx` - **Status:** stable (since 2026-05) - **Description:** Titled content card with rounded-xl + border + bg-surface-raised + p-6. Header is separated by an underline; children slot accepts arbitrary content. **Variants:** *Tek bölüm* ```tsx ``` *Birden fazla bölüm* ```tsx ``` ### InlineAlert (`inline-alert`) - **Layer:** app - **Category:** App - **File:** `modules/app/InlineAlert.tsx` - **Status:** stable (since 2026-05) - **Description:** Compact inline alert strip used next to form fields or inside cards. success / error / warning / info variants; icon + single-line message. **Variants:** *Tüm variantlar* ```tsx ``` ### StepShell (`step-shell`) - **Layer:** app - **Category:** App - **File:** `modules/app/StepShell.tsx` - **Status:** stable (since 2026-05) - **Description:** Wrapper card for a single step in a multi-step flow. Border and number circle change based on active / done / inactive state; the done + onEdit combination shows an Edit button alongside the summary. **Variants:** *Active / Done / Pending* ```tsx } onEdit={() => setStep('address')} /> ``` ### Form (`form`) - **Layer:** app - **Category:** App - **File:** `modules/app/Form.tsx` - **Status:** stable (since 2025-03) - **Description:** Form layout wrapper with title, description, error and actions slots. `columns` prop renders fields in a 1 or 2 column grid. - **Design tokens:** --border, --primary, --secondary, --text-primary, --text-secondary **Variants:** *Single column* ```tsx
} >