Knit UI
GitHub

Architecture

The layers

your app
  ├── @knitui/components      what you render      (100+ components)
  ├── @knitui/core            how it looks         (config, tokens, themes, Provider, styled)
  ├── @knitui/hooks           platform-aware hooks
  ├── @knitui/icons           generated glyphs
  └── @knitui/plugins         build integration    (babel · metro · next · vite · webpack)
        └── Tamagui + react-native / react-native-web

Satellite kits — dates, carousel, map, media, graphics, sheet, mediaquery, emoji — sit beside components and depend on core. Install only what you use.

PackageVersionExportsWhat it is
@knitui/core0.8.0123Design tokens, theme and cross-platform primitives for Knit UI.
@knitui/components0.8.0552Cross-platform (React Native + Web) component kit for Knit UI.
@knitui/hooks0.8.077Shared React hooks used across Knit UI.
@knitui/icons0.8.06,157Hybrid React + React Native icon kit generated from @tabler/icons SVG data.
@knitui/emoji0.8.03,811Hybrid React + React Native emoji kit generated from Google Noto Emoji SVG data.
@knitui/dates0.8.0198Date and time components for Knit UI.
@knitui/carousel0.3.765Cross-platform carousel for Knit UI (Embla-style engine).
@knitui/map0.4.3105Cross-platform MapLibre map surface for Knit UI.
@knitui/media0.4.18Audio and video players, playlists and visualizers for Knit UI.
@knitui/graphics0.8.086Skia-powered graphics primitives and effects for Knit UI.
@knitui/sheet0.3.714Cross-platform bottom sheet for Knit UI.
@knitui/mediaquery0.8.030Cross-platform media queries and responsive breakpoints for Knit UI (React Native + web, SSR-safe).
@knitui/plugins0.1.110Pre-configured Tamagui build-tool plugins for the knitui UI kit (babel, metro, next, vite, webpack) plus the Next.js SSR provider.

src-shipping

The kit's main points at ./src/index.ts, not a built bundle. Two reasons:

  1. Platform resolution. Input.tsx and Input.native.tsx both exist; your bundler picks. A prebuilt bundle would have had to pick for you.
  2. Extraction. The Tamagui compiler needs real source to flatten styled() calls into atomic CSS.

The cost is that your bundler compiles the kit, which is why @knitui/plugins exists and why transpilePackages is required on Next.

Types are the exception: types resolves to built declarations (lib/typescript), so a consumer's tsc does not have to re-check the kit's source.

Platform splits

Three conventions, in increasing separation:

PatternMeans
One .tsxIdentical on all platforms (most components)
One .tsx with isWeb branchesSmall divergence — a position: fixed that native has no equivalent for
.tsx + .native.tsxGenuinely different implementations
+ .shared.tsBoth platforms delegate to one logic module

.shared is the interesting one: it is how a scroll engine, a snap engine or a DSP pipeline stays a single pure-TypeScript implementation while the thin platform files wire it to Reanimated worklets or to requestAnimationFrame.

Components with a real native split: FileButton, Input, NativeSelect, Popover, Modal, ScrollArea, Transition — plus the drag primitives. Each one's page says so, and links both files.

Where things run

ConcernNativeWeb
StylingTamagui runtimeatomic CSS + runtime for .styleable() frames
AnimationReanimated worklets (UI thread)CSS transitions / rAF painters
Gesturesreact-native-gesture-handlerRNGH's web build + pointer events
Portalsreact-native-teleportteleport into the host in Provider
Textnative text nodesreact-native-web text

The rendering surfaces

The kit is exercised by three surfaces that all read the same story files, which is how they stay honest:

  • Storybook — per-package, plus an aggregate build; the contributor surface.
  • The device gallery (@knitui/demo) — the same stories rendered in an Expo app and a Next app, so iOS/Android parity is checked continuously.
  • This site — the same stories again, mounted live in prose.

They share one CSF resolver (@knitui/story-runtime), so a story cannot look right in one and wrong in another.

Release model

Changesets, published to npm under the @knitui scope. Packages version independently; core and components move together in practice. See Contributing.