Give the text, then place the word and the controls.
focus-reader.tsx
TextSpeedReader
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| locale | string | — | The BCP 47 locale for the letter and word split (Intl.Segmenter). Default: the DisplayLocaleProvider locale, else "en-US". |
| text | string | — | The text to read, one word at a time. |
| children | ReactNode | — | The parts. Default: the word, the controls row, and the progress. |
| wpm | number | — | The speed in words per minute (controlled). |
| default | number | SPEED_READER_WPM.default | The first speed when wpm is not set. Default 300. |
| on | — | ||
| labels | — | The words the item writes: button names, the speed unit, the time left. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TextSpeedReaderWord
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TextSpeedReaderControls
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TextSpeedReaderPlay
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "icon" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "default" | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
TextSpeedReaderStep
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "icon" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "ghost" | |||||
| direction | "back""forward" | — | back shows the word before, forward the word after. Both pause. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
TextSpeedReaderSpeed
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||
| control | ReactNode | — | The control under the children. Default: a SliderControl with the track, the indicator, and one thumb per value. Pass your own SliderControl to change a part (a thumb with a Tooltip). | |||||||||||||||||||||||||||||||||||||||||||||||||
| thumb | Omit<SliderThumbProps, "index"> | — | Props for every default thumb: getAriaLabel, getAriaValueText, aria-label, disabled. | |||||||||||||||||||||||||||||||||||||||||||||||||
| tone | "destructive""info""neutral""success""warning" | — | default: the primary fill. A status colors the fill and the thumb edge: success a good value, warning a value that needs care, info a neutral mark, destructive a value over a limit. Color is never the only signal: say it in words too. | |||||||||||||||||||||||||||||||||||||||||||||||||
| glow | boolean | — | A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false. | |||||||||||||||||||||||||||||||||||||||||||||||||
| variant | "bare""default""playhead" | — | default: the track, the fill, and round thumbs. playhead: an invisible track over the parent's whole box and a 2px line thumb, for a scrub over a waveform or a timeline (the parent draws the played part). bare: the same press area with thumbs that the item draws (children of SliderThumb), for the handles of a timeline. Default default. | |||||||||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | "Speed" | The label. Default "Speed". | |||||||||||||||||||||||||||||||||||||||||||||||||
From Base UISlider.RootBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the slider should ignore user interaction. | |||||||||||||||||||||||||||||||||||||||||||||||||
| format | NumberFormatOptions | — | Options to format the value. | |||||||||||||||||||||||||||||||||||||||||||||||||
| locale | LocalesArgument | — | The locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale. | |||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||
TextSpeedReaderProgress
<div>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
| glow | boolean | — | A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false. | ||||||||||||||||||
| tone | "destructive""info""neutral""success""warning" | — | The fill color: default (primary), or a status for a task whose state has a meaning: success done, warning slow or nearly full, info a neutral step, destructive failed. Color is never the only signal: say the state in the label or value. | ||||||||||||||||||
From Base UIProgress.RootBase UI docs | |||||||||||||||||||||
| aria-valuetext | string | — | A string value that provides a user-friendly name for aria-valuenow, the current value of the progress bar. | ||||||||||||||||||
| format | NumberFormatOptions | — | Options to format the value. | ||||||||||||||||||
| get | — | Accepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress bar. | |||||||||||||||||||
| |||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||
| ArrowLeft / ArrowRight | On the word or a control: steps one word back or on (mirrored right to left). |
|---|---|
| Home / End | Goes to the first or the last word. |
| Space / Enter | Presses the focused button: play, pause, or a step. |
Built with
Installs with Text Speed Reader









