ui-lab-registry
v0.1.5
Published
Component registry and metadata management for ui-lab-components
Maintainers
Readme
ui-lab-registry
A centralized, framework-agnostic component registry for the UI Lab ecosystem.
Overview
This package serves as the single source of truth for:
- Component metadata (names, descriptions, categories)
- Component source code references
- Component relationships and dependencies
- Category definitions and organization
- Starter template component mappings
Installation
npm install ui-lab-registry
# or
pnpm add ui-lab-registryUsage
Basic Registry Access
import {
componentRegistry,
getComponentById,
getComponentsByCategory,
categories
} from 'ui-lab-registry';
// Get a single component
const button = getComponentById('button');
// Get all components in a category
const inputComponents = getComponentsByCategory('input');
// Get all categories
console.log(categories);Helper Functions
import {
searchComponents,
getRelatedComponents,
getComponentsGroupedByCategory,
getAllComponentIds,
getComponentCount
} from 'ui-lab-registry';
// Search components by name, description, or tags
const results = searchComponents('button');
// Get related components
const relatedToButton = getRelatedComponents('button');
// Get components grouped by category
const grouped = getComponentsGroupedByCategory();
// Get all component IDs
const ids = getAllComponentIds();
// Get component count
const count = getComponentCount(); // 23Starter Presets
import { starterPresets, getStarterComponents } from 'ui-lab-registry';
// Get components for a specific starter template
const nextComponents = getStarterComponents('next');
// Access preset metadata
const preset = starterPresets.vite;
console.log(preset.description); // "Lightweight components for Vite-based applications"Types
import type {
ComponentMetadata,
ComponentCategory,
ComponentSource,
CategoryDefinition,
StarterPreset
} from 'ui-lab-registry';
function processComponent(comp: ComponentMetadata): void {
console.log(comp.name, comp.category);
}Component Categories
The registry organizes components into 8 categories:
- input - Form inputs and data entry
- display - Information display
- feedback - User feedback
- navigation - Navigation elements
- container - Container components
- action - Action components
- composition - Composed components
- layout - Layout utilities
All 23 Components
- button - Clickable element that triggers an action
- button-group - Group of related buttons
- input - Text input field
- label - Text label for form elements
- select - Dropdown select component
- textarea - Multi-line text input
- checkbox - Checkbox input
- radio - Radio button
- badge - Badge component for labels
- tooltip - Tooltip component
- popover - Popover component
- form - Form wrapper component
- toast - Toast notification component
- modal - Modal dialog component
- tabs - Tabbed interface
- menu - Context Menu
- switch - Toggle switch
- slider - Range slider
- progress - Progress bar
- card - Card component
- command - Command palette
- confirm - Confirm dialog
- divider - Divider component
TypeScript Support
This package includes full TypeScript support with strict typing. All types are exported from the main entry point.
License
MIT
