libraryPackage manifestv8.0.6

lib.ui-kit

Cross-platform UI components for React Native and web

@lssm-tech/lib.ui-kit
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 8.0.6. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
react-nativeservernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.ui-kitplatform

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

12 declarations · first 6 shownSELECT TO INSPECT

@lssm-tech/lib.ui-kit

@lssm-tech/lib.ui-kit provides cross-platform UI components for native-first and Expo-based surfaces, with most real usage happening through ./ui/* subpaths rather than the root barrel.

Website: https://contractspec.io

Installation

bun add @lssm-tech/lib.ui-kit

or

npm install @lssm-tech/lib.ui-kit

What belongs here

This package owns the native-first component layer for ContractSpec UI work:

  • React Native and Expo component wrappers.
  • Shared UI building blocks such as forms, tables, overlays, navigation, loading states, marketing blocks, and visualization surfaces.
  • Platform-aware helpers such as useColorScheme and list state helpers.

Use this package for Expo and React Native surfaces. Do not use it as the design-token layer or as the framework-agnostic link package.

API map

Forms and inputs

  • ./ui/input
  • ./ui/input-password
  • ./ui/textarea
  • ./ui/select
  • ./ui/form
  • ./ui/field

Native contract-driven forms consume the shared Field semantics through the design-system renderer; web-only input-addon composition remains in @lssm-tech/lib.ui-kit-web/ui/input-group and the design-system platform facade.

./ui/input-password provides the native masked password primitive with current/new password autocomplete hints and a right-side visibility toggle.

Overlays and menus

  • ./ui/dialog
  • ./ui/alert-dialog
  • ./ui/popover
  • ./ui/sheet
  • ./ui/dropdown-menu
  • ./ui/context-menu
  • ./ui/portal
  • ./ui/toast
  • ./ui/toolbar

./ui/sheet is the native edge-anchored panel: Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle and SheetDescription match @lssm-tech/lib.ui-kit-web/ui/sheet, so Metro's ui-kit-web/ui/* remap lands on a working sheet. It is built on @rn-primitives/dialog (controlled or uncontrolled open, dialog semantics, Android back and the accessibility escape gesture close it). SheetContent slides in from side (right by default) and merges className after the side classes; a scrim press or the close button (closeLabel) dismisses it. React Native does not link SheetTitle to the dialog, so pass accessibilityLabel to SheetContent to name it for screen readers. Under a SafeAreaProvider (from react-native-safe-area-context), the screen edges the panel touches are padded by their non-zero insets, replacing className padding on those edges (style still wins), and the close button clears the status bar and notch. Mount <PortalHost /> from ./ui/portal once at the app root, or pass portalHost.

Navigation and display

  • ./ui/link
  • ./ui/sidebar
  • ./ui/navigation-menu
  • ./ui/page-header
  • ./ui/stack
  • ./ui/table
  • ./ui/data-table
  • ./ui/card
  • ./ui/empty-state
  • ./ui/slider

Stack and Box layout intent

./ui/stack exports the native Box, HStack, and VStack primitives. Treat direction as part of the component contract:

  • Use VStack for vertical sections, card content, forms, lists, and panels.
  • Use HStack for horizontal rows, toolbars, chips, inline metrics, and action groups.
  • Use Box as a neutral wrapper, semantic surface, single-child container, or explicit true-grid/custom-positioning host.
  • Do not introduce new Box usage that depends on implicit flex direction, default spacing, centered alignment, or className-only stack layout.

Box is neutral by default and no longer injects legacy row/gap/center layout. Legacy layout behavior is available only through the temporary legacyBoxLayout compatibility bridge while owned callsites migrate. New code must not use that bridge; replace Box className="flex flex-col gap-4" with VStack gap="md" or Box className="flex flex-row items-center" with HStack align="center". spacing, width, and padding remain native-lane transition props behind legacy compatibility; the shared cross-platform stack subset is gap, align, justify, and wrap.

Data table example

The canonical data-table example lives in @lssm-tech/example.data-grid-showcase†. Its native-first lane renders the same account-grid controller through @lssm-tech/lib.ui-kit/ui/data-table:

tsx
import { DataTable } from '@lssm-tech/lib.ui-kit/ui/data-table';
import { useContractTable } from '@lssm-tech/lib.presentation-runtime-react';

import { SHOWCASE_ROWS } from '@lssm-tech/example.data-grid-showcase/ui/data-grid-showcase.data';
import { useShowcaseColumns } from '@lssm-tech/example.data-grid-showcase/ui/data-grid-showcase.columns';
import {
  ExpandedRowContent,
  ShowcaseToolbar,
} from '@lssm-tech/example.data-grid-showcase/ui/data-grid-showcase.parts';

export function NativeAccountGrid() {
  const columns = useShowcaseColumns();

  const controller = useContractTable({
    data: SHOWCASE_ROWS,
    columns,
    selectionMode: 'single',
    initialState: {
      sorting: [{ id: 'arr', desc: true }],
      pagination: { pageIndex: 0, pageSize: 4 },
      columnVisibility: { notes: false },
      columnPinning: { left: ['account'], right: [] },
    },
    renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
    getCanExpand: () => true,
  });

  return (
    <DataTable
      controller={controller}
      toolbar={
        <ShowcaseToolbar
          controller={controller}
          label="Native primitive"
          primaryColumnId="account"
          toggleColumnId="notes"
          pinColumnId="owner"
          sortColumnIds={['arr', 'renewalDate']}
        />
      }
      loading={false}
      footer={\`Rows \${controller.rows.length}\`}
    />
  );
}

Cells receive overflow behavior from the table controller. Native renderers use single-line ellipsis for truncate and expand, multiline text for wrap, and preserve caller rendering for none.

This example explicitly demonstrates the same sorting, pagination, selection, column visibility, column resizing, left/right pinning, row expansion, loading, and empty-state contracts used by the browser lanes.

Hooks, utilities, and grouped surfaces

  • ./ui/useColorScheme
  • ./ui/useListState
  • ./ui/utils
  • grouped subpaths under ./ui/marketing, ./ui/usecases, and ./ui/visualization
  • icons under ./ui/icons/*
  • shared semantic contracts are defined in @lssm-tech/lib.ui-kit-core/interfaces

Public surface

The current root entry exists, but it is not the meaningful consumer surface for this package.

Consumers should import ./ui/* subpaths directly. The public surface is best understood in groups:

  • atoms and controls
  • forms
  • overlays and menus
  • navigation and layout
  • data display
  • loading and empty states
  • marketing and use-case blocks
  • organisms and visualization
  • hooks, utilities, and icons

Use package.json as the exhaustive source of truth for all exported subpaths.

Operational semantics and gotchas

  • Consumers should import subpaths directly; the root package is not the useful primary API today.
  • Many components wrap Expo, React Native, or RN-oriented primitives and dependencies.
  • ./ui/link is router-coupled through expo-router.
  • ./ui/useColorScheme is built on nativewind.
  • ./ui/utils exposes a local cn() helper, but the deeper compatibility dependency is @lssm-tech/lib.ui-kit-core.
  • This package is native-first even when some components can render cross-platform through React Native Web.

When not to use this package

  • Do not use it for pure web-first Radix or Next.js surfaces.
  • Do not use it for token or theming orchestration.
  • Do not use it for framework-agnostic link behavior.
  • @lssm-tech/lib.ui-kit-core: tiny shared utility layer used by the UI packages.
  • @lssm-tech/lib.ui-kit-web: web-first component package for React and Next surfaces.
  • @lssm-tech/lib.design-system: higher-level design-system and composition layer built on top of the UI packages.

Local commands

  • bun run lint:check
  • bun run typecheck

Graph & Timeline Primitives

@lssm-tech/lib.ui-kit ships native graph and timeline primitives backed by react-native-svg for Expo and React Native surfaces.

@lssm-tech/lib.ui-kit/ui/graph:

  • GraphCanvas — native SVG graph renderer; same GraphCanvasProps interface as the web lane

@lssm-tech/lib.ui-kit/ui/timeline:

  • Timeline — native SVG timeline renderer
  • TimelineGraph — native combined timeline + graph view

All three respect prefers-reduced-motion via the reducedMotion prop (parity with web lane).

Metro aliases (withPresentationMetroAliases) automatically map @lssm-tech/lib.ui-kit-web/ui/* subpaths to @lssm-tech/lib.ui-kit/ui/* for native surfaces. Product code can import from @lssm-tech/lib.design-system and let the alias system route to the correct primitive.

See AGENTS.md for layer placement and full import rules.

Native compiler compatibility

The workspace development compiler is pinned to Babel 7.29.7. The installed Expo 57 and React Native Worklets presets use Babel 7 transforms; resolving this package to Babel 8 prevents Metro from exporting native skeleton/worklet components. Qualify the presets and compiler together before upgrading this pin. iOS/Android export success is build evidence, not real-device accessibility or release acceptance.

Standalone declaration exports keep their existing public subpath names. The shared builder preserves their original declaration suffix and copies checked source declarations into dist, without overwriting emitted implementation types.

Declared capabilities.

Lib Ui Kit

Cross-platform UI components for React Native and web

Use it to

  • Adopt cross-platform ui components for react native and web

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.ui-kit package constraints do not match the target runtime or platform.

@lssm-tech/lib.ui-kit

@lssm-tech/lib.ui-kit/preview-panel

@lssm-tech/lib.ui-kit/preview-panel/focus-management

@lssm-tech/lib.ui-kit/preview-panel/modes/BottomSheet

@lssm-tech/lib.ui-kit/preview-panel/modes/Drawer

@lssm-tech/lib.ui-kit/preview-panel/modes/HoverPopover

@lssm-tech/lib.ui-kit/preview-panel/modes/Modal

@lssm-tech/lib.ui-kit/preview-panel/modes/Popover

@lssm-tech/lib.ui-kit/preview-panel/PreviewPanelRouter

@lssm-tech/lib.ui-kit/preview-panel/shared/motion

@lssm-tech/lib.ui-kit/preview-panel/shared/panel-base-props

@lssm-tech/lib.ui-kit/preview-panel/shared/use-panel-effects

Imports and export paths.

213 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

213 imports · showing 35

Dependencies and related packages.

Runtime dependencies 12
@react-navigation/native
^7.4.1
@types/dagre
^0.7.54
class-variance-authority
^0.7.1
clsx
^2.1.1
dagre
^0.8.5
react-use
^17.6.1
tailwind-merge
catalog:ui
Peer dependencies 71
@hookform/resolvers
catalog:ui
@react-native-async-storage/async-storage
^2.1.2 || ^3.1.1
@react-native-community/datetimepicker
^9.2.1
@rn-primitives/accordion
^1.4.0
@rn-primitives/alert-dialog
^1.4.0
@rn-primitives/aspect-ratio
^1.4.0
@rn-primitives/avatar
~1.4.0 || ~1.5.2
@rn-primitives/checkbox
^1.4.0
@rn-primitives/collapsible
^1.4.0
@rn-primitives/context-menu
^1.4.0
@rn-primitives/dialog
^1.4.0
@rn-primitives/dropdown-menu
^1.4.0
@rn-primitives/hover-card
^1.4.0
@rn-primitives/label
^1.4.0
@rn-primitives/menubar
^1.4.0
@rn-primitives/navigation-menu
^1.4.0
@rn-primitives/popover
^1.4.0
@rn-primitives/portal
~1.4.0 || ~1.5.3
@rn-primitives/progress
~1.4.0 || ~1.5.2
@rn-primitives/radio-group
^1.4.0
@rn-primitives/select
^1.4.0
@rn-primitives/separator
^1.4.0
@rn-primitives/slider
^1.4.0
@rn-primitives/slot
~1.4.0 || ~1.5.2
@rn-primitives/switch
^1.4.0
@rn-primitives/table
^1.4.0
@rn-primitives/tabs
^1.4.0
@rn-primitives/toast
^1.4.0
@rn-primitives/toggle
^1.4.0
@rn-primitives/toggle-group
^1.4.0
@rn-primitives/toolbar
^1.4.0
@rn-primitives/tooltip
~1.4.0 || ~1.5.2
@wuba/react-native-echarts
^3.0.1
burnt
^0.13.0
echarts
catalog:ui
expo
^57.0.21
expo-application
~57.0.2
expo-build-properties
~57.0.17
expo-constants
~57.0.17
expo-dev-client
~57.0.18
expo-device
~57.0.1
expo-file-system
~57.0.2
expo-linear-gradient
~57.0.1
expo-linking
~57.0.9
expo-localization
~57.0.1
expo-navigation-bar
~57.0.2
expo-router
~57.0.20
expo-secure-store
~57.0.3
expo-splash-screen
~57.0.6
expo-status-bar
catalog:native
expo-system-ui
~57.0.3
expo-updates
~57.0.21
expo-web-browser
~57.0.2
lucide-react
catalog:ui
lucide-react-native
catalog:ui
nativewind
catalog:native
react
^19.2.3
react-dom
catalog:
react-hook-form
^7.72.1
react-native
catalog:native
react-native-device-info
^14.1.1 || ^15.0.2
react-native-gesture-handler
>=2.0.0
react-native-localize
^3.7.0
react-native-reanimated
catalog:native
react-native-safe-area-context
5.6.2 || ~5.7.0
react-native-screens
4.23.0 || ~4.26.0
react-native-svg
15.15.5
react-native-web
~0.21.2
tailwindcss
catalog:build
tailwindcss-animate
catalog:ui
zod
catalog:
Development dependencies 79
@babel/core
catalog:native
@hookform/resolvers
catalog:ui
@react-native-async-storage/async-storage
^3.1.1
@react-native-community/datetimepicker
^9.2.1
@rn-primitives/accordion
1.5.2
@rn-primitives/alert-dialog
1.5.2
@rn-primitives/aspect-ratio
1.5.2
@rn-primitives/avatar
1.5.2
@rn-primitives/checkbox
1.5.2
@rn-primitives/collapsible
1.5.2
@rn-primitives/context-menu
1.5.2
@rn-primitives/dialog
1.5.2
@rn-primitives/dropdown-menu
1.5.2
@rn-primitives/hover-card
1.5.2
@rn-primitives/label
1.5.2
@rn-primitives/menubar
1.5.2
@rn-primitives/navigation-menu
1.5.2
@rn-primitives/popover
1.5.2
@rn-primitives/portal
1.5.3
@rn-primitives/progress
1.5.2
@rn-primitives/radio-group
1.5.2
@rn-primitives/select
1.5.2
@rn-primitives/separator
1.5.2
@rn-primitives/slider
1.5.2
@rn-primitives/slot
1.5.2
@rn-primitives/switch
1.5.2
@rn-primitives/table
1.5.2
@rn-primitives/tabs
1.5.2
@rn-primitives/toast
1.5.2
@rn-primitives/toggle
1.5.2
@rn-primitives/toggle-group
1.5.2
@rn-primitives/toolbar
1.5.2
@rn-primitives/tooltip
1.5.2
@types/react
catalog:native
@wuba/react-native-echarts
^3.1.1
burnt
^0.13.0
echarts
catalog:ui
expo
~57.0.21
expo-application
~57.0.2
expo-build-properties
~57.0.17
expo-constants
~57.0.17
expo-dev-client
~57.0.18
expo-device
~57.0.1
expo-file-system
~57.0.5
expo-linear-gradient
~57.0.1
expo-linking
~57.0.9
expo-localization
~57.0.1
expo-navigation-bar
~57.0.2
expo-router
~57.0.20
expo-secure-store
~57.0.3
expo-splash-screen
~57.0.8
expo-status-bar
catalog:native
expo-system-ui
~57.0.3
expo-updates
~57.0.21
expo-web-browser
~57.0.2
happy-dom
catalog:testing
lucide-react
catalog:ui
lucide-react-native
catalog:ui
nativewind
catalog:native
react
^19.2.3
react-dom
catalog:
react-hook-form
catalog:ui
react-native
catalog:native
react-native-css
catalog:native
react-native-device-info
^15.0.2
react-native-gesture-handler
catalog:native
react-native-localize
^3.7.0
react-native-reanimated
catalog:native
react-native-safe-area-context
catalog:native
react-native-screens
catalog:native
react-native-svg
catalog:native
react-native-web
^0.21.2
tailwindcss
catalog:build
tailwindcss-animate
catalog:ui
typescript
catalog:
zod
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrm -rf dist
lintbun run lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
testbun test --isolate --pass-with-no-tests
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Your view

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.