index

@statelyjs/ui - UI Infrastructure

Low-level UI infrastructure for Stately applications. This package provides the foundational components, theming, plugin system, and runtime builder that power Stately UIs.

For Most Users

Use @statelyjs/stately instead. It provides statelyUi() which includes the core plugin automatically:

import { statelyUi, StatelyProvider, useStatelyUi } from '@statelyjs/stately';

For Plugin Authors

Use this package directly when building UI plugins:

import {
  createOperations,
  type DefineUiPlugin,
  type UiPluginFactory,
} from '@statelyjs/ui';

Key Exports

  • createStatelyUi - Low-level runtime builder (without core plugin)
  • createUiPlugin - Create a UI plugin factory function that users will import
  • createOperations - Create typed API operations from bindings
  • DefineUiPlugin - Helper type for defining UI plugins
  • ThemeProvider - Theme context provider

Functions

devAssert()

devAssert(condition, message, context?): asserts condition

Defined in: packages/ui/src/lib/assertions.ts:35

Assert a condition is true in development mode.

In development: throws an error with a detailed message and logs context. In production: silently returns (does not throw or log).

Use this for internal library invariants that should never fail if the library code is correct. E2E tests running in dev mode will catch violations.

Parameters

condition

boolean

The condition that must be true

message

string

Error message describing what went wrong

context?

Record<string, unknown>

Optional additional context for debugging

Returns

asserts condition

Example

devAssert(
  input.type === expectedType,
  `Entity type mismatch: expected "${expectedType}", got "${input.type}"`,
  { input, expectedType }
);

References

AllUiPlugins

Re-exports AllUiPlugins


AnyUiAugments

Re-exports AnyUiAugments


AnyUiPlugin

Re-exports AnyUiPlugin


camelCaseToKebabCase

Re-exports camelCaseToKebabCase


cn

Re-exports cn


ComponentRegistry

Re-exports ComponentRegistry


createExtensible

Re-exports createExtensible


createFeaturePlugin

Re-exports createFeaturePlugin


createOperations

Re-exports createOperations


createStatelyUi

Re-exports createStatelyUi


createUiPlugin

Re-exports createUiPlugin


defaultStorageKey

Re-exports defaultStorageKey


defaultThemeOption

Re-exports defaultThemeOption


defaultUiOptions

Re-exports defaultUiOptions


defineExtension

Re-exports defineExtension


DefineOptions

Re-exports DefineOptions


DefineRoutes

Re-exports DefineRoutes


DefineUiPlugin

Re-exports DefineUiPlugin


DefineUiUtils

Re-exports DefineUiUtils


devLog

Re-exports devLog


devLogger

Re-exports devLogger


ExtendInput

Re-exports ExtendInput


Extensible

Re-exports Extensible


ExtensibleConfig

Re-exports ExtensibleConfig


ExtensibleHook

Re-exports ExtensibleHook


ExtensionPoint

Re-exports ExtensionPoint


ExtensionPointConfig

Re-exports ExtensionPointConfig


ExtensionState

Re-exports ExtensionState


FeatureComponent

Re-exports FeatureComponent


FeatureComponentProps

Re-exports FeatureComponentProps


FeaturePlugin

Re-exports FeaturePlugin


FeaturePluginConfig

Re-exports FeaturePluginConfig


FeaturePluginContext

Re-exports FeaturePluginContext


FieldEditProps

Re-exports FieldEditProps


FieldViewProps

Re-exports FieldViewProps


generateFieldFormId

Re-exports generateFieldFormId


generateFieldLabel

Re-exports generateFieldLabel


mergePathPrefixOptions

Re-exports mergePathPrefixOptions


NodeTypeComponent

Re-exports NodeTypeComponent


PluginFunction

Re-exports PluginFunction


PluginFunctionMap

Re-exports PluginFunctionMap


PluginRuntime

Re-exports PluginRuntime


registry

Re-exports registry


RegistryKey

Re-exports RegistryKey


RegistryMode

Re-exports RegistryMode


RouteOption

Re-exports RouteOption


runtimeUtils

Re-exports runtimeUtils


StatelyUiBuilder

Re-exports StatelyUiBuilder


StatelyUiConfiguration

Re-exports StatelyUiConfiguration


StatelyUiRuntime

Re-exports StatelyUiRuntime


stripLeading

Re-exports stripLeading


stripTrailing

Re-exports stripTrailing


Theme

Re-exports Theme


ThemeProvider

Re-exports ThemeProvider


ThemeProviderProps

Re-exports ThemeProviderProps


ThemeToggle

Re-exports ThemeToggle


toKebabCase

Re-exports toKebabCase


toSpaceCase

Re-exports toSpaceCase


toTitleCase

Re-exports toTitleCase


TypedOperations

Re-exports TypedOperations


UiNavigationOptions

Re-exports UiNavigationOptions


UiOptions

Re-exports UiOptions


UiPluginConfig

Re-exports UiPluginConfig


UiPluginContext

Re-exports UiPluginContext


UiPluginFactory

Re-exports UiPluginFactory


UiPluginFactoryFn

Re-exports UiPluginFactoryFn


UiPluginResult

Re-exports UiPluginResult


UiPluginRuntime

Re-exports UiPluginRuntime


UiRegistry

Re-exports UiRegistry


UiUtils

Re-exports UiUtils


useTheme

Re-exports useTheme