labsUI
Accent color

Table of Contents

Links to a page's sections that follow the reader on a sliding marker, on the page or in a nested scroller. Short sections at the end still get a turn, and a clicked link stays current where it lands. Links work without JS.

npx @kznlabs/labsui add table-of-contents

Recording

Acme keeps the last two minutes of every match in memory. Nothing reaches the disk until a player asks for a clip or a round ends in a way the server marks as worth keeping.

A clip starts a few seconds before the moment it marks, so the lead-up is in it. Length, quality and frame rate come from the server's settings, and players can't change them.

Recording stops by itself when the server gets busy. Matches always come first, and a missing clip is cheaper than a stutter during a round.

Uploading

Finished clips upload in the background, one at a time, at a rate the server owner chooses. A clip is playable as soon as its first few seconds arrive.

Uploads pause while a match is running on a small server and pick up between rounds. The queue survives a restart, so nothing has to start over.

When an upload fails

A failed upload retries five times, waiting longer after each try. After that the clip stays on disk and the owner gets one message, not five.

Retrying by hand starts from where the upload stopped. A clip that was removed in the meantime leaves the queue with a short note in the log.

Keeping clips

Clips stay for thirty days, or until the owner deletes them.

Deleting

Deleting a clip removes it everywhere.

<TableOfContents>

Links to a page's sections that follow the reader. Works on the page or in a nested scroller, and short sections at the end still get their turn. Give the root a max-h-* and it scrolls itself, keeping the current link in view.

  • items required
    TableOfContentsItem[]
    Sections in page order.
  • hideLabelDefault false
    boolean
    Keeps label for screen readers only, e.g. inside a Collapsible that already says it.
  • labelDefault "On this page"
    string
    Title over the list and the navigation's accessible name.
  • offsetDefault 96
    number
    Pixels below the top of the scroller where a heading becomes current. Keep it at or above the headings' scroll-margin-top.
PropTypeDefault
items required
Sections in page order.
TableOfContentsItem[]—
hideLabel
Keeps label for screen readers only, e.g. inside a Collapsible that already says it.
booleanfalse
label
Title over the list and the navigation's accessible name.
string"On this page"
offset
Pixels below the top of the scroller where a heading becomes current. Keep it at or above the headings' scroll-margin-top.
number96

required

Also accepts every <nav> prop.

type TableOfContentsItem
{ id: string; label: string; level?: number; }

Every component also takes className.