Reference

UI kit

@doan-labs/duo-uikit: the components and tokens every app on the phone is built from. They already know about the cover and the inner display, so a screen that reads at 387 points grows into the room it gets unfolded.

TypeScript
1import {
2 Button, Row, Screen, Section, Text, Title, useDisplay
3} from '@doan-labs/duo-uikit'
4
5function App() {
6 const view = useDisplay()
7 return (
8 <Screen>
9 <Title>Field guide</Title>
10 <Section>
11 <Row label="Display" detail={view.display} />
12 <Row label="Fold" detail={<Text value={view.angle} suffix="°" />} />
13 <Row><Button onClick={save}>Continue</Button></Row>
14 </Section>
15 </Screen>
16 )
17}

Version 1.2.0. Apps bundle the kit they compile against, so a new version never changes whether a host can run an installed app. Components accept native attributes, as for the element, animate for the CSS-only presets and xstyle for compiled StyleX extensions, and refuse raw style and className. The showcase composes the kit into small live apps, and the Developer gallery is an installable app that renders every export at both display widths.

Exports

Tokens

Colours, type and easing live in tokens.stylex.ts as StyleX variables. Use them and never a literal: the two displays have different densities, the shell tunes the palette for both, and that rule is what lets a fix in the kit reach every app.