Skip to content

Type scalePro

Oxyn original: Sans, Serif or Mono, A− / A+ around a stepped size slider and three line spacings, on a reading sample that counts its line length.

oxyn add type-scale
16 px

After hours

Evening reading should feel easy. Pick a family, nudge the size until a line sits comfortably under your eye, and give the lines a little room to breathe.

16 px · 1.5 lines · about 63 characters a line, comfortable

The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Set how text reads – family, size and line spacing – on a real paragraph, with a hint about line length.

When not to use

  • Picture tiles we draw ourselves plus Your own, with Film, Static or Dither laid over the picture and a home screen preview: use Background picker instead.
  • Eight mini-window swatches: use Theme grid instead.
  • Oxyn original: use Theme split instead.

Installation

Type scale is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add type-scale

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Default

Sans at 16 px with normal spacing.

16 px

After hours

Evening reading should feel easy. Pick a family, nudge the size until a line sits comfortably under your eye, and give the lines a little room to breathe.

16 px · 1.5 lines · about 63 characters a line, comfortable

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Serif relaxed

Serif at 18 px with relaxed lines: a reading view.

18 px

After hours

Evening reading should feel easy. Pick a family, nudge the size until a line sits comfortably under your eye, and give the lines a little room to breathe.

18 px · 1.75 lines · about 60 characters a line, comfortable

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Mono tight

Mono at 14 px, tight: a code-first setting.

14 px

After hours

Evening reading should feel easy. Pick a family, nudge the size until a line sits comfortably under your eye, and give the lines a little room to breathe.

14 px · 1.3 lines · about 62 characters a line, comfortable

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

TypeScale

PropTypeDefaultDescription
default_familyString"sans"Starting family (`sans`, `serif`, `mono`).
default_stepusize3Starting size step (0–5: 13, 14, 15, 16, 18, 20 px).
default_spacingString"normal"Starting spacing (`tight`, `normal`, `relaxed`).
measure_widthf64520.0Width the line count is worked out for, in px.
on_changeEventHandler<(String, u32, f64)>—Any choice changed: (family, px, line height).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabFamily, A−, the size slider, A+, spacing
LeftorRight on the sliderOne size step
EnterorSpacePicks a family or spacing, or steps the size

Accessibility

  • Family and spacing are radio groups; each family name is set in its own face.
  • A− and A+ are named Smaller text and Larger text and disable at the ends; the slider says its size in px.
  • The readout under the sample is a polite live region with size, spacing and line length.

Responsive behaviour

  • 560 px card; controls stack under 480 px.
Edge cases (spec)

Controls stack under 480 px.

Notes for AI

  • Import TypeScale from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: TypeScaleEl in oxyn_gpui.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI