Repository navigation
v1.33.0 — Site layout, code highlighting and the docs kit
·
209 commits
to main
since this release
Everything a documentation or marketing site needs is now in the package: a site frame, a footer, a menubar, a copy button, a back-to-top button, and code blocks with highlighting and install tabs. Nothing published was removed.
New components
- SiteLayout: the frame of a documentation or marketing site, and the site's counterpart to AppLayout. It holds a SiteHeader, a scrollable NavList sidebar, the page and an on-this-page AnchorNav, with SiteFooter below. Its width is
contained(innarrow,defaultorwidesteps) orfull, and the sidebar docks to the content or to the window's edge. It renders on the server. - SiteFooter: a sitemap footer with link columns, a brand block and a copyright row.
- Menubar: a row of menus that open with the arrow keys, built on DropdownMenu's items (groups, checkbox and radio rows, sub-menus, shortcuts).
- CopyButton: puts a value on the clipboard and says so, as a button or an icon-only circle.
- BackToTop: a round button that appears once the reader has scrolled a long way and takes them back to the top. It respects reduced motion.
Code
- CodeBlock takes pre-highlighted
lines, coloured through the new--color-code-*tokens, plusshowLineNumbersandhighlightLines. Withoutlinesit stays monochrome, as before. - CodeBlock
tabsshow grouped snippets, such as install commands, under one header. Blocks that share asyncKeyfollow one pick, remembered across visits. rift-ds/codeexportspackageManagerTabs(pkg).rift-ds/code/highlightexportshighlight(code, lang), behind the new optionalshikipeer, so nothing else pulls it in.
New on existing components
- AnchorNav
fromHeadingsbuilds the on-this-page list from the page's own headings and keeps it current.useHeadingItemsis the same thing as a hook. - Heading and SectionTitle
anchorgive a heading an id and a link that copies its URL. - NavList takes titled
sectionsas well as items, with badges, ascrollableform and acompactsize. - SiteHeader
widthputs the bar on the contained or full width axis.foldBelowfolds it into its menu at a breakpoint. On a full bar, the mega menu hangs from the section pills only past--ds-site-header-menu-hang-from. - Pagination
variant="adjacent"shows previous and next links as two cards. - ArtifactPanel
layout="inline"sits in the page flow as a preview and code example. - Rating
variant="thumbs"asks a thumbs up or down question, for page feedback. - Figure carries a do or don't verdict through
variant. - Link
variant="skip"is a skip link, hidden until focused. - Table columns take
monofor code-set cells. npx rift-ds init block docsscaffolds a documentation page that uses all of the above.
Changed
- AppLayout's
widthnow defaults tocontainedin every mode. Theinsetmode used to force full width. Passwidth="full"to keep an edge-to-edge inset layout. - NavList, single-open: opening a row now closes only its siblings, never the section or the rows around it. Left uncontrolled, the branch holding the current page opens on top of
defaultExpandedIds. - Only one menu is open at a time. A tooltip or hover card showing over an open menu no longer stops a press outside from closing it, so opening a second menu closes the first.
- ShaderScene rebuilds a lost graphics context on a fresh canvas once it comes back near the screen, instead of waiting for the browser.
Upgrading
Nothing to change unless you use AppLayout's inset mode and want it edge to edge: add width="full". If you passed defaultExpandedIds={[]} to NavList to keep every row closed, the current page's branch now opens.
Install
npm install rift-ds@1.33.0