@sublime-ui/ui
v4.0.1
Published
Cross-platform navigation (storybook → React Navigation / react-router) and layout primitives for Sublime UI.
Maintainers
Readme
@sublime-ui/ui
Cross-platform navigation and layout primitives for Sublime UI.
Navigation is authored as a storybook — a book of pages, written once per
platform — and compiled ahead of time (by @sublime-ui/devkit's build:nav)
into idiomatic React Navigation (mobile) and react-router (web), with a fully
typed route map.
import { book, page, link } from '@sublime-ui/ui/navigation';
import { Home } from '../screens/web/Home';
export default book({
format: 'sidebar', // web: 'sidebar' | 'stack' | 'tabs'
pages: {
home: page(Home, { title: 'Home' }),
},
});At runtime, useNav() gives you type-checked navigation: turnTo, turnBack,
current, and params<T>(). Layout primitives (Screen, Stack, Row,
Spacer) render natively on each platform.
Install
npm install @sublime-ui/uiDocumentation
The storybook model and typed navigation: https://sublime-ui.github.io/sublime-ui/docs/navigation/storybook
License
MIT
