Docs
A help center reader with a contents tree, outline, and ⌘K search.
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.
Related components
| Region | Components | Role |
|---|---|---|
| Top bar | TxKbd, TxCommandPalette | ⌘K search over articles and sections |
| Contents | TxSearchInput, TxTree, TxBadge | Filterable, collapsible contents tree |
| Toolbar | TxBreadcrumb, TxDropdownMenu, TxProgressBar | Breadcrumbs, outline menu, reading progress |
| Article | TxMarkdownView, TxAvatar | Body, contributors, and update date |
| Article feedback | TxFlatRadio, TxCheckbox, TxTextarea, TxButton | Helpful or not, with reasons |
| Previous / next and related | TxCardItem | Neighbors and related articles |
| On this page (expanded) | Hand-built list + useIndicatorBox | Highlights the section being read |
| Feedback | TxToastPanel | Results of links, edits, and feedback |