Installation
Add SurfaceOne to an Angular 22 application in three steps.
1. Install the packages
npm install @surface-one/angular @surface-one/tokensThe markdown entry point also needs its optional peers (marked, dompurify and the @codemirror/* packages). Install them only if you import @surface-one/angular/markdown.
2. Load the styles
Add the tokens and the component stylesheet to the styles array of your build target, tokens first:
"styles": [
"@surface-one/tokens",
"@surface-one/angular/styles.css",
"src/styles.css"
]Component styles are global on purpose: most parts are projected or portaled, where emulated encapsulation cannot reach.
3. Enable localization
Components mark their built-in strings (such as “Close”) with $localize, so add the polyfill:
ng add @angular/localizeUse a component
import { Component } from "@angular/core";
import { SoneButtonDirective } from "@surface-one/angular/button";
import { SoneSwitchComponent } from "@surface-one/angular/switch";
@Component({
selector: "app-root",
imports: [SoneButtonDirective, SoneSwitchComponent],
template: `
<sone-switch [(checked)]="enabled" ariaLabel="Notifications" />
<button soneBtn variant="outline" type="button">Save</button>
`,
})
export class App {
enabled = true;
}Next, pick a skin and colour mode on the Theme page.