Skip to content

Apps and screens ​

An app is a place in the sidebar, under Apps. Opening it opens a tab showing one of its screens; the tab's header switches between them. An extension can bring several apps, or none.

json
"apps": [
  {
    "id": "graph",
    "name": "Graph",
    "icon": "graph.svg",
    "screens": [{ "id": "graph", "title": "Graph", "entry": "graph.html" }]
  }
]
Key
idThe app's key.
nameUp to 60 characters.
iconA path in the folder; the extension's icon if left out.
screensAt least one.
placeapps (the default) or places. See below.

For a single app, give screens at the top of the manifest instead of apps. The app is then named after the extension.

Screens ​

Key
idThe screen's key, unique across the extension.
titleUp to 40 characters.
entryThe HTML page, such as index.html.
moduleOptional. A module Sorus runs in its own window instead, for an extension signed by Sorus.

A screen is an ordinary web page. Its scripts connect to Sorus with the SDK:

js
import { connect } from '/__pages/sdk.js'
const pages = await connect()

pages.screen says which screen this is. Move to another with pages.navigate({ screen: 'diary' }), or open something in Sorus with pages.navigate({ object: id }) or pages.navigate({ page: id }).

Look like Sorus ​

A screen gets Sorus's colors and font as CSS variables on its root, and they change when the person changes theirs:

Variable
--pages-backgroundThe page
--pages-surfacePanels
--pages-raisedRaised controls
--pages-borderBorders
--pages-text, --pages-text-muted, --pages-text-faintText
--pages-accent, --pages-accent-soft, --pages-on-accentThe accent, a soft version, and text on it
--pages-errorErrors
--pages-radiusCorner radius
--pages-fontThe font

The root also has data-pages-scheme="light" or "dark", and its color-scheme is set to match.

Places ​

"place": "places" puts the app among Sorus's own places, beside Today and Calendar, and lets its icon name one of Sorus's icons as pages:<name>. Both take effect only for extensions signed by Sorus; for any other, the app goes under Apps.

The person can pin any app to the Library from its menu.