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.

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.

SourceWebSwift
ds1/1-root/palette.ts and the component tokens: every colour, its pastel, dark and dim versions, and the surfaceslight-dark() tokensDS1Color, a ShapeStyle that follows light and dark
ds1/1-root/measures.ts: the square, control and row heights, type, tracking, lines, corners, the scalegrid.css, one.css, component-metrics.cssDS1Metrics in points
Typefaces in ds1/1-root/fonts@font-faceThe woff2 files, which Core Text reads
Icons in ds1/x-iconSVGVector images in an asset catalogue
ds1/1-root/i18n.ts and the shared words in ds1/1-root/translationsconfigureI18n, translate()DS1Language, DS1Words
  • 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 --sf does 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-paper on 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.

Every public piece of the web library has a native counterpart with the same name, except where noted.

WebSwift
Theme, scale, preferences.ds1Theme(), .ds1Scaled(), DS1Preferences
ds-textDS1LineText, DS1Figures
ds-iconDS1Icon
ds-button, icon button, dangerDS1ButtonStyle (.buttonStyle(.ds1(.primary))), DS1IconButton, DS1DangerButton
ds-button splitDS1SplitButton
ds-input, multilineDS1Field (rows:), DS1FieldStyle
ds-checkbox, ds-radio, choice tilesDS1CheckboxStyle, DS1Checkbox, DS1Radio, DS1Choice
ds-switchDS1SwitchStyle (.ds1Switch)
ds-select, a fieldDS1Select (the system’s menu)
ds-tabsDS1Tabs
ds-tagDS1Tag (complete label, optional leading content)
ds-badge, ds-token, ds-swatch, link, ds-gapDS1Badge, DS1Token, DS1Swatch, DS1Link, DS1Gap
ds-avatar, ds-avatar-groupDS1Avatar, DS1AvatarGroup
ds-message (banner), ds-empty, ds-loadingDS1Notice (banner:), DS1Empty, DS1Loading
ds-tooltip.ds1Tooltip(_:)
ds-cycle, its language pickerDS1Cycle, DS1ThemeCycle, DS1LanguageCycle
toast() and its stackDS1Toast, DS1ToastHost
ds-overlay, alert, confirm, promptDS1OverlayBox, .ds1Overlay, DS1Overlays
ds-select, a menu from a buttonDS1Menu, DS1MenuItem (floating menus are the system’s)
ds-contextthe system’s context menu (.contextMenu)
ds-accordion, ds-list, ds-panelDS1Accordion, DS1List, DS1Panel
ds-sidebar, ds-table, ds-token-fieldDS1Sidebar, DS1Table, DS1TokenField
ds-page and its layouts, tilesDS1Page, DS1PageLayout, DS1Tiles
ds-row, ds-gridDS1Row, DS1Rule, DS1PaperGrid
format.ts, pricing.ts, copyTextDS1Format, DS1Pricing, DS1Clipboard
ds-barsDS1Bars, 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.

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.

  • 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.