Rootless

Automate iOS, iPadOS, and macOS using plain JavaScript. Build custom widgets and interact directly with native APIs.

Download on the App Store
Rootless app interface

Plain JavaScript

Supports ES6. Scripts are stored as plain .js files on your disk.

Native APIs & Documentation

Integrate directly with iOS native APIs. Fully documented, available offline.

Siri Shortcuts

Trigger scripts via Siri. Present tables, websites, and custom HTML natively.

System Integration

Run from the Share Sheet, process inputs, and manage local files via Files.app.

x-callback-url

Communicate seamlessly and trigger workflows with other apps on your device.

Customizable & Ready

Tailor the code editor to your liking. Includes several example scripts to start immediately.

Documentation

Also inside the app, or as rootless.json.

Text

Display text with styling options

Renders a string. Set type with font; see Font for the named styles and Font.custom.

Methods

Text(content, options?)WidgetNode

Renders a string.

  • content String required

    The string to render.

  • options Any
    • font RootlessFont

      Size, weight, family and design as one value.

    • color Color

      Text colour.

    • textAlign TextAlign

      A TextAlign, for alignment inside the available width.

    • maxLines Number

      Truncate beyond this many lines.

    • overflow TextOverflow

      A TextOverflow, for how truncation looks. Needs maxLines.

    • lineSpacing Number

      Extra points between lines.

Text.timer(endsAt, options?)WidgetNode

A clock that keeps counting without a timeline reload. Counts down to endsAt (epoch seconds, a DateTime, or a Date), or up once it has passed. Use this for anything live, a widget only redraws every few minutes.

  • endsAt Any required

    A DateTime, a Date, or epoch seconds. Counts down to it, and up once it has passed.

  • options Any
    • font RootlessFont

      Size, weight, family and design as one value.

    • color Color

      Text colour.

    • textAlign TextAlign

      A TextAlign, for alignment inside the available width.

    • maxLines Number

      Truncate beyond this many lines.

    • overflow TextOverflow

      A TextOverflow, for how truncation looks. Needs maxLines.

    • lineSpacing Number

      Extra points between lines.

Text.measure(text, options?)Any

How big this string will be. Pair with Widget.size rather than guessing whether text fits.

  • text String required

    The string to measure.

  • options Any
    • font RootlessFont

      The font it will be drawn in. Left out, the system font at 14 points.

    • maxWidth Number

      The width it has to fit in.

    • maxLines Number

      The line budget, for fits.

returns { width, height, lines, lineHeight, fits }. fits is false when the string needs more lines than maxLines allows.

Examples

Styled text

Text("Hello World", {
  color: Color.white(),
  font: Font.system(24, FontWeight.bold),
  textAlign: "center"
})