Native
Design system 1 comes as a Swift package for iPhone, iPad and Mac as well as the stylesheet. It carries the same colours, type, square, scale, icons and words as the web, and offers the same pieces under the same names, so a screen built from Design system 1 matches the web.
Status: first version. The package builds and tests on its own, and apps copy it with Sync 1. It is not published to a package registry yet. Android support is coming soon.
One source, two outputs
Section titled “One source, two outputs”The stylesheet stays the reference, and nothing in the native package is typed by hand. A script (vp run native:tokens) reads Design system 1’s sources and writes the Swift files, and a test fails when a generated file and its source disagree.
| Source | Web | Swift |
|---|---|---|
ds1/1-root/palette.ts and the component tokens: every colour, its pastel, dark and dim versions, and the surfaces | light-dark() tokens | DS1Color, a ShapeStyle that follows light and dark |
ds1/1-root/measures.ts: the square, control and row heights, type, tracking, lines, corners, the scale | grid.css, one.css, component-metrics.css | DS1Metrics in points |
Typefaces in ds1/1-root/fonts | @font-face | The woff2 files, which Core Text reads |
Icons in ds1/x-icon | SVG | Vector images in an asset catalogue |
ds1/1-root/i18n.ts and the shared words in ds1/1-root/translations | configureI18n, translate() | DS1Language, DS1Words |
What carries over
Section titled “What carries over”- The square. One square is 20 points on Apple platforms, the same as 20 CSS pixels. Rows, items and headers are one square high; widths and gaps are whole squares or half a square.
- The scale. On a computer every measure is multiplied by 1. On a phone or tablet it is multiplied by the screen width over 280, between 0.75 and 2, rounded to three decimals, exactly as
--sfdoes on the web. - Type. 14 text on 16 lines, 10 small and 13 headings, with −0.3 letter spacing. Arrows are always Inter; figures can be Olivetti Dot, each digit in a cell of one width. Type stays on the grid rather than following the system text size.
- Lines and corners. 1-point lines on the grid. Rows and items stay square; pictures, buttons and fields round their corners by 4, and an app may change that corner for its whole interface.
- The paper. Pages, page layouts, panels, dialogs, menus and fields stand on one paper,
--ds-paperon the web. An app that wants another paper sets it once at its root:.ds1Paper(DS1Color.white)in SwiftUI. Everything inside follows it, as everything on a web page follows--ds-paper. - Light and dark. Colours switch with the appearance, inks turn over, and pastels become their dim versions. The theme a person chooses (light, dark or system) is saved on the device.
- Words. The shared words in every language, looked up as the web does: the language, its primary subtag, its relatives, then English. A product registers its own words on top.
- Motion. Only position, scale and opacity animate, and every animation stands still when the system asks for reduced motion.
The pieces
Section titled “The pieces”Every public piece of the web library has a native counterpart with the same name, except where noted.
| Web | Swift |
|---|---|
| Theme, scale, preferences | .ds1Theme(), .ds1Scaled(), DS1Preferences |
ds-text | DS1LineText, DS1Figures |
ds-icon | DS1Icon |
ds-button, icon button, danger | DS1ButtonStyle (.buttonStyle(.ds1(.primary))), DS1IconButton, DS1DangerButton |
ds-button split | DS1SplitButton |
ds-input, multiline | DS1Field (rows:), DS1FieldStyle |
ds-checkbox, ds-radio, choice tiles | DS1CheckboxStyle, DS1Checkbox, DS1Radio, DS1Choice |
ds-switch | DS1SwitchStyle (.ds1Switch) |
ds-select, a field | DS1Select (the system’s menu) |
ds-tabs | DS1Tabs |
ds-tag | DS1Tag (complete label, optional leading content) |
ds-badge, ds-token, ds-swatch, link, ds-gap | DS1Badge, DS1Token, DS1Swatch, DS1Link, DS1Gap |
ds-avatar, ds-avatar-group | DS1Avatar, DS1AvatarGroup |
ds-message (banner), ds-empty, ds-loading | DS1Notice (banner:), DS1Empty, DS1Loading |
ds-tooltip | .ds1Tooltip(_:) |
ds-cycle, its language picker | DS1Cycle, DS1ThemeCycle, DS1LanguageCycle |
toast() and its stack | DS1Toast, DS1ToastHost |
ds-overlay, alert, confirm, prompt | DS1OverlayBox, .ds1Overlay, DS1Overlays |
ds-select, a menu from a button | DS1Menu, DS1MenuItem (floating menus are the system’s) |
ds-context | the system’s context menu (.contextMenu) |
ds-accordion, ds-list, ds-panel | DS1Accordion, DS1List, DS1Panel |
ds-sidebar, ds-table, ds-token-field | DS1Sidebar, DS1Table, DS1TokenField |
ds-page and its layouts, tiles | DS1Page, DS1PageLayout, DS1Tiles |
ds-row, ds-grid | DS1Row, DS1Rule, DS1PaperGrid |
format.ts, pricing.ts, copyText | DS1Format, DS1Pricing, DS1Clipboard |
ds-bars | DS1Bars, DS1BarItem |
Left out on purpose: the 2-core card (off the system: no boxes around content), ds-form (the platform’s own forms), and page dots. The other charts (ds-chart, ds-spark, ds-ratio, ds-range), the composer, and ds-stat, ds-meter and ds-steps follow later; until then a native figure is DS1Figures on its lines.
What stays native
Section titled “What stays native”The package gives native controls Design system 1’s measures and colours rather than redrawing the platform. Navigation, sheets, text selection, keyboards, pickers for files and colours, and accessibility come from SwiftUI. On Apple platforms, floating menus and a select’s options are the system’s own menus.
Checks
Section titled “Checks”vp run native:test: writes the generated files, then builds and tests the Swift package.vp test: holds the generated files to their sources and the Sync 1 exports to the package folders.
On iPhone and iPad, .ds1Theme() owns one scene layer above presented sheets. Confirmations and prompts receive touches and the keyboard there; toast-only messages pass touches through outside their chips. Session owners can cancel all pending reviews with DS1Overlays.cancelAll() and clear messages with DS1Toast.dismiss(). macOS still uses a view overlay: keep sheet-specific reviews inline until that platform is verified. Other consumers receive this behavior when they next adopt the Swift snapshot.