Velocity X Components

Long-form

Reading Preferences Toggle

Lets readers pick a comfortable text size and line width for a long article and remembers the choice for their next visit, instead of forcing one fixed measure on everyone. Labelled buttons and a radiogroup, never icon-only controls, and it degrades gracefully if storage is blocked.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add reading-preferences-toggle

Built for astro.

Full docs for Reading Preferences Toggle →

Needs a licence key — subscribe here, then velocityx loginonce.

astro v1.0.1
Reading Preferences Toggle
Text size
Line width

Props

NameTypeRequiredDefaultDescription
targetstringYes`id` of the element whose font size + measure this should control.
labelstringNo'Reading preferences'Visually hidden group label.

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/reading-preferences-toggle/ReadingPreferences.astro

Using the Reading Preferences Toggle component

Install it with velocityx add reading-preferences-toggle. The CLI writes the source straight into your project — no runtime dependency, no registry lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.

More from Long-form.