Component Registry Reference
Complete technical reference for the UI Lab Component Registry. This document describes the registry structure, data format, and access methods.
Registry Data Structure
Component Object
Each component in the registry has this structure:
VariantInfo
Example:
PropDefinition
Example:
AccessibilityInfo
Example:
CompositionInfo
Example:
DesignInfo
Example:
SourceInfo
Example:
Component Categories
Components are organized by category:
| Category | Components | Purpose |
|----------|------------|---------|
| action | Button, Link, IconButton | User interactions |
| input | Input, TextArea, Select, Checkbox, Radio, Switch | Form inputs |
| layout | Flex, Grid, Card, Fold, Gallery | Layout and composition |
| navigation | Tabs, Menu, Breadcrumbs, Divider | Navigation and structure |
| feedback | Modal, Toast, Popover, Tooltip, Progress | Feedback and overlays |
| information | Label, Badge | Information display |
| data | Table, Form | Data and composition |
API Reference
TypeScript Imports
Registry Methods
list()
Get all components:
find(id: string)
Find component by ID:
findByCategory(category: string)
Find all components in a category:
search(query: string)
Search components by name, description, or tags:
getComponentProps(componentId: string)
Get all props for a component:
getVariants(componentId: string)
Get all variants for a component:
getAccessibility(componentId: string)
Get accessibility info:
Common Components
Button
Input
Flex
Grid
Accessing the Registry Programmatically
JavaScript/TypeScript
JSON Export
Export registry as JSON:
Use in your application:
Validation
Validate Component Props
Validate Component Composition
LLMs.txt Format
Export registry in LLMs.txt format:
This generates machine-readable documentation for AI systems.
MCP Server Access
Query the registry via MCP server:
Best Practices
For AI Systems
- Check Variants First – Always consult the variants documentation
- Use Semantic Props – Reference tokens and named values
- Verify Composition – Check
canContainbefore nesting - Include Accessibility – Follow accessibility guidelines
- Respect Responsive – Handle responsive variants appropriately
For Registry Maintainers
- Keep Examples Current – Update examples when component changes
- Document Edge Cases – Note unusual behaviors or constraints
- Maintain Composition Rules – Keep
canContain/canBeContainedByaccurate - Include Patterns – Document common usage patterns
- Version Registry – Update version when components change
Updating the Registry
To update component metadata:
- Update metadata file in
packages/registry/src/components/[id].ts - Run registry generation:
npm run registry:generate - Commit updated
packages/registry/src/generated-data.ts - Deploy to update live registry
Example component metadata file:
Version History
The registry is versioned alongside the component library:
Check the current version:
The registry is the single source of truth for UI Lab components.