Docs

A help center reader with a contents tree, outline, and ⌘K search.

Since 0.6.0BETA

This component doc is in progress

This page is still being migrated. Demos and API details may change.

Usage

Three-pane docs

Once in view the article scrolls itself to two sections and stops when you touch it; ⌘K searches articles and sections.

Loading demo...

Overview

Tuff's three-pane help center; the featured article, "Plugin permissions," uses the real permission registry, and the rest is sample content.

  • The first time it scrolls into view, the article scrolls to Risk levels and then Choosing at install time; a click, key, wheel, or touch ends it, and reduced motion starts at the second section.
  • The tour moves only the article's own scroller, never the page or focus.
  • The outline is parsed from the markdown source and matched to the rendered headings by position; TxMarkdownView headings have no id, and the template adds none.
  • Picking an outline entry scrolls smoothly to that section and keeps it highlighted until you scroll the article yourself.
  • Body links are intercepted in one place: #kb: links open the article inside the template; external links, middle clicks, and ⌘-clicks only report what the host would open.
  • In the column (640–959px) the outline moves into a toolbar dropdown; expanded, it is three panes; below 640px the tree becomes a panel that slides in from the left.
  • ⌘K is bound on the template root and works only while focus is inside; closing the palette returns focus to the search button.

Customization

  • With real docs, keep parsing the outline from the source; before switching to a renderer that adds heading ids, make sure no script on the page scrolls the document by id.
  • For highlighted code, render the whole article with TxStreamMarkdown (not streaming); mixing renderers in one body breaks the heading positions.
  • With many articles, run ⌘K search remotely as the reader types, and index only second-level sections.
  • Have the feedback endpoint record the article id, the chosen reasons, and the article version.
RegionComponentsRole
Top barTxKbd, TxCommandPalette⌘K search over articles and sections
ContentsTxSearchInput, TxTree, TxBadgeFilterable, collapsible contents tree
ToolbarTxBreadcrumb, TxDropdownMenu, TxProgressBarBreadcrumbs, outline menu, reading progress
ArticleTxMarkdownView, TxAvatarBody, contributors, and update date
Article feedbackTxFlatRadio, TxCheckbox, TxTextarea, TxButtonHelpful or not, with reasons
Previous / next and relatedTxCardItemNeighbors and related articles
On this page (expanded)Hand-built list + useIndicatorBoxHighlights the section being read
FeedbackTxToastPanelResults of links, edits, and feedback