Documentation
¶
Overview ¶
Copyright (c) 2025 Reliant Labs
Package native embeds the React Native component primitives that ship in `@<scope>/ui-native`. Distinct from the sibling `components` package which embeds the web (Tailwind/DOM) library — RN primitives are useless on the web (Tailwind class names mean nothing to a <View>) and DOM components are useless on RN, so the two libraries stay in separate packages with no overlap in registry.
Surface is deliberately small (~10 primitives). For anything bigger (data tables, sidebars, complex layouts) the answer on native is a real design system — Tamagui or Unistyles — not more primitives hand-rolled here. See the `ui-native-package` skill for the reasoning.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Library ¶
type Library struct{}
Library is the RN counterpart to components.Library. Kept as a distinct type so callers that statically depend on "the native library" don't accidentally pick up DOM components.
func NewLibrary ¶
func NewLibrary() *Library
NewLibrary returns a Library handle. Stateless — the underlying registry lives in package globals.
func (*Library) IndexBarrel ¶
IndexBarrel renders the canonical `src/index.ts` re-export barrel for the package. Generated rather than embedded so the export list always stays in lockstep with the primitive registry — adding a new primitive to `primitives` automatically picks it up in the barrel.
func (*Library) Primitives ¶
Primitives returns the full list of RN primitives.
type Primitive ¶
type Primitive struct {
// Name is the kebab-cased file stem (e.g. "button", "safe-area-view").
Name string `json:"name"`
// Description is a one-line summary for documentation generation.
Description string `json:"description"`
// FilePath is the embed-relative path to the .tsx source.
FilePath string `json:"-"`
}
Primitive describes a single React Native primitive shipped by the library. Mirrors the shape of components.Entry but with a flatter schema — there are no categories yet, only primitives.