npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@object-ui/types

v3.0.3

Published

Pure TypeScript type definitions for Object UI - The Protocol Layer

Readme

@object-ui/types

Pure TypeScript type definitions for Object UI - The Protocol Layer.

Features

  • 🎯 Complete Type Coverage - Every component has full TypeScript definitions
  • 🏛️ Built on @objectstack/spec - Extends the universal UI component specification
  • 📦 Minimal Dependencies - Only depends on @objectstack/spec (pure types)
  • 🔌 Framework Agnostic - Use with React, Vue, or any framework
  • 🌍 Backend Agnostic - Works with REST, GraphQL, ObjectQL, or local data
  • 🎨 Tailwind Native - Designed for Tailwind CSS styling
  • 📚 Comprehensive JSDoc - Every type is fully documented

Installation

npm install @object-ui/types
# or
yarn add @object-ui/types
# or
pnpm add @object-ui/types

Important: This package depends on @objectstack/spec which provides the foundational protocol.

Architecture: The Inheritance Chain

Object UI follows a strict "Protocol First" approach with a clear inheritance hierarchy:

@objectstack/spec (v2.0.1)          ← The "Highest Law" - Universal protocol
    ↓
UIComponent                         ← Base interface for all UI components
    ↓
BaseSchema (@object-ui/types)       ← ObjectUI extensions (visibleOn, hiddenOn, etc.)
    ↓
Specific Schemas                    ← Component implementations (ChartSchema, etc.)
    ↓
@object-ui/core (Engine)            ← Schema validation and expression evaluation
    ↓
@object-ui/react (Framework)        ← React renderer
    ↓
@object-ui/components (UI)          ← Shadcn/Tailwind implementation

This separation allows:

  • ✅ Multiple UI implementations (Shadcn, Material, Ant Design)
  • ✅ Multiple framework bindings (React, Vue, Svelte)
  • ✅ Multiple backend adapters (REST, GraphQL, ObjectQL)
  • ✅ Static analysis and validation without runtime dependencies
  • ✅ Compliance with the ObjectStack ecosystem standards

Usage

Basic Example

import type { FormSchema, InputSchema, ButtonSchema } from '@object-ui/types';

const loginForm: FormSchema = {
  type: 'form',
  fields: [
    {
      name: 'email',
      type: 'input',
      inputType: 'email',
      label: 'Email',
      required: true,
    },
    {
      name: 'password',
      type: 'input',
      inputType: 'password',
      label: 'Password',
      required: true,
    }
  ],
  submitLabel: 'Sign In'
};

Advanced Example

import type { DataTableSchema, FlexSchema, CardSchema } from '@object-ui/types';

const dashboard: CardSchema = {
  type: 'card',
  title: 'User Management',
  content: {
    type: 'data-table',
    columns: [
      { header: 'Name', accessorKey: 'name' },
      { header: 'Email', accessorKey: 'email' },
      { header: 'Role', accessorKey: 'role' }
    ],
    data: [], // Connected to data source
    pagination: true,
    searchable: true,
    selectable: true
  }
};

Type Narrowing

import type { AnySchema, SchemaByType } from '@object-ui/types';

function renderComponent(schema: AnySchema) {
  if (schema.type === 'input') {
    // TypeScript automatically narrows to InputSchema
    console.log(schema.placeholder);
  }
}

// Or use the utility type
type ButtonSchema = SchemaByType<'button'>;

Type Categories

Base Types

Foundation types that all components build upon:

  • BaseSchema - The base interface for all components
  • SchemaNode - Union type for schema nodes (objects, strings, numbers, etc.)
  • ComponentMeta - Metadata for component registration
  • ComponentInput - Input field definitions for designers/editors

Layout Components

Structure and organization:

  • ContainerSchema - Max-width container
  • FlexSchema - Flexbox layout
  • GridSchema - CSS Grid layout
  • CardSchema - Card container
  • TabsSchema - Tabbed interface

Form Components

User input and interaction:

  • FormSchema - Complete form with validation
  • InputSchema - Text input field
  • SelectSchema - Dropdown select
  • CheckboxSchema - Checkbox input
  • RadioGroupSchema - Radio button group
  • DatePickerSchema - Date selection
  • And 10+ more form components

Data Display Components

Information presentation:

  • DataTableSchema - Enterprise data table with sorting, filtering, pagination
  • TableSchema - Simple table
  • ListSchema - List with items
  • ChartSchema - Charts and graphs
  • TreeViewSchema - Hierarchical tree
  • TimelineSchema - Timeline visualization

Feedback Components

Status and progress:

  • LoadingSchema - Loading spinner
  • ProgressSchema - Progress bar
  • SkeletonSchema - Loading placeholder
  • ToastSchema - Toast notifications

Overlay Components

Modals and popovers:

  • DialogSchema - Modal dialog
  • SheetSchema - Side panel/drawer
  • PopoverSchema - Popover
  • TooltipSchema - Tooltip
  • DropdownMenuSchema - Dropdown menu

Navigation Components

Menus and navigation:

  • HeaderBarSchema - Top navigation bar
  • SidebarSchema - Side navigation
  • BreadcrumbSchema - Breadcrumb navigation
  • PaginationSchema - Pagination controls

Complex Components

Advanced composite components:

  • KanbanSchema - Kanban board
  • CalendarViewSchema - Calendar with events
  • FilterBuilderSchema - Advanced filter builder
  • CarouselSchema - Image/content carousel
  • ChatbotSchema - Chat interface

Data Management

Backend integration:

  • DataSource - Universal data adapter interface
  • QueryParams - Query parameters (OData-style)
  • QueryResult - Paginated query results
  • DataBinding - Data binding configuration

Design Principles

1. Protocol Agnostic

Types don't assume any specific backend:

interface DataSource<T = any> {
  find(resource: string, params?: QueryParams): Promise<QueryResult<T>>;
  create(resource: string, data: Partial<T>): Promise<T>;
  // Works with REST, GraphQL, ObjectQL, or anything
}

2. Tailwind Native

All components support className for Tailwind styling:

const button: ButtonSchema = {
  type: 'button',
  label: 'Click Me',
  className: 'bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded'
};

3. Type Safe

Full TypeScript support with discriminated unions:

type AnySchema = 
  | InputSchema 
  | ButtonSchema 
  | FormSchema 
  | /* 50+ more */;

function render(schema: AnySchema) {
  switch (schema.type) {
    case 'input': /* schema is InputSchema */ break;
    case 'button': /* schema is ButtonSchema */ break;
  }
}

4. Composable

Components can nest indefinitely:

const page: FlexSchema = {
  type: 'flex',
  direction: 'col',
  children: [
    { type: 'header-bar', title: 'My App' },
    {
      type: 'flex',
      direction: 'row',
      children: [
        { type: 'sidebar', nav: [...] },
        { type: 'container', children: [...] }
      ]
    }
  ]
};

Comparison

vs Amis Types

  • Lighter - No runtime dependencies
  • Tailwind Native - Built for Tailwind CSS
  • Better TypeScript - Full type inference
  • Framework Agnostic - Not tied to React

vs Formily Types

  • Full Pages - Not just forms, entire UIs
  • Simpler - More straightforward API
  • Better Docs - Comprehensive JSDoc

Contributing

We follow these constraints for this package:

  1. ZERO runtime dependencies - Only TypeScript types
  2. No React imports - Framework agnostic
  3. Comprehensive JSDoc - Every property documented
  4. Protocol first - Types define the contract

License

MIT

Links