Teletext
Teletext pages on a 40×25 grid in the eight broadcast colours: double-height rows, 2×3 mosaic block graphics, flash, a header with the page number, service and clock, and the four coloured Fastext keys. Type three digits to tune, and the counter searches the broadcast before the page shows; subpages rotate. It fills its parent at 4:3 and scales the grid to it, so it fits a TV's screen. Pages are data; each is a region with a heading and real text, with goToPage and fastext for agents.
Example
ESKAIS TEXT INDEX
Installation
Usage
Reach for it for a retro information service, alone or inside a TV: listings, news, scores, weather, each a page of data. It fills its parent at 4:3; inside a RetroTv, pass screen="flat" and it fills the screen and keeps its eight colours, with the TV's switch-off over the page.
API reference
Teletext
| Prop | Type | Default |
|---|---|---|
labelrequiredThe set's accessible name: "Teletext". | string | – |
pagesrequiredThe service's pages by number, 100 to 899. | Readonly<Record<number, TeletextPage>> | – |
serviceThe service's name on the header row, up to about ten characters. | string | "" |
clockShows the date and a running clock on the header row, in the page's locale. Default true. | boolean | true |
searchMsHow long the counter runs through the broadcast before a new page shows, in ms. 0 shows it at once. Default 900. | number | 900 |
subpageMsHow long each subpage stays before the next, in ms. Default 12000. | number | 12_000 |
screen`crt` (the default) adds scanlines and a darker rim, as a tube set had; `flat` leaves them to a screen it sits in. | "crt" | "flat" | "crt" |
localeThe locale for the header's date and clock; the page's `lang` by default. | string | – |
labels | Partial<TeletextLabels> | – |
classNameClasses for the set; a function gets the page shown and whether it's searching. | string | ((state: TeletextState) => string | undefined) | – |
Also takes TeletextOptions except pages.
Other exports
teletextLabelsteletextcellsOffastextColorsfirstPagefittedSpanslastPagenormalRowpageColumnspageRowsrowsOfsubpageCountteletextMosaicuseTeletextClockuseTeletextSearchuseTeletextSubpagestype TeletextLabelstype TeletextPropstype TeletextStatetype TeletextOptionstype TeletextPageChangeReasontype FastextColortype FastextLinktype NormalRowtype TeletextColortype TeletextPagetype TeletextRowtype TeletextSpanAccessibility
- Each page is a region named by its title, with a heading; its text is real text and its mosaics are hidden from screen readers.
- The page takes focus: three digits tune and Backspace takes one back, and Left and Right turn subpages, which hold still while it has focus or the pointer.
- Fastext keys are buttons named by their words, with 44px touch targets. Flash and the search counter stop under reduced motion.
Agent actions
Agents find it by its label and call goToPage or fastext, or press a Fastext key by its word; a page the service doesn't have fails the step with the pages it has.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.