Reading
A screen for long-form reading: documentation with a page tree.
Installation & usage
npx @youj/cli add content-docsAlso installs alert, anchor-nav, async-button, badge, breadcrumb, button, collapsible, command, command-palette, icon-arrow-left, icon-arrow-right, icon-bookmark, icon-check, icon-code, icon-copy, icon-menu, icon-pencil, icon-search, icon-sparkle, icon-thumbs-down, icon-thumbs-up, kbd, morph-label, reveal, sheet, sliding-indicator, table, tabs, use-controllable-state, youj-core, youj-presets, youj-ui-core.
The CLI copies the block to blocks/content/docs.tsx with every component it uses, so it’s yours to edit.
Every prop is optional and falls back to the demo, so it renders as you see it until you pass your own. Give it your data, rewrite or translate its strings through copy, and connect its actions:
'use client'
import Link from 'next/link'
import { Docs, type DocsProps } from '@/blocks/content/docs'
export function DocsView({ pages, brand }: Pick<DocsProps, 'pages' | 'brand'>) {
return (
<Docs
pages={pages}
brand={brand}
copy={{ openNavigation: 'Open navigation' }}
linkComponent={Link}
onPageChange={(page) => {
// your code
}}
onFeedback={(page, vote) => {
// your code
}}
/>
)
}Description
Documentation with a page tree beside each article and an outline of its headings, a search palette, code tabs and a feedback prompt.
Code
Docs, the Docs story: the files youj add writes.
blocks/content
Reference
Props12 props, 2 types
Props
| Prop | Type | |
|---|---|---|
theme | ThemeInputA theme to force on the block. Default: none, so it inherits the app's (YoujProvider or a ThemeScope around it). | – |
pages | Page[]The pages, in nav order; their default Northstar's SDK docs | Northstar's SDK docs |
page | stringThe open page's id, controlled: pair it with | – |
defaultPage | stringThe page open first, when the docs own it. default 'installation' | 'installation' |
onPageChange | (page: string) => void | – |
getHref | (page: Page) => stringEach page's route; links then navigate instead of switching in place. | – |
linkComponent | ElementTypeRenders page links, e.g. Next.js default 'a' | 'a' |
brand | DocsBrandThe product in the header: default Northstar | Northstar |
version | string | nullThe version badge; default 'v2.4' | 'v2.4' |
getEditHref | ((page: Page) => string) | nullWhere "Edit this page" goes; default '#edit' | '#edit' |
onFeedback | (page: string, vote: 'yes' | 'no') => voidHears "Was this page helpful?". | – |
copy | Partial<DocsCopy>Any of the docs' strings, to rewrite or translate. | – |
DocsBrand
| Prop | Type | |
|---|---|---|
nameRequired | string | – |
logo | ReactNodeYour mark before the name. Default: the demo's sparkle tile. | – |
href | stringWhere the name links. default '#northstar' | '#northstar' |
DocsEntry
| Prop | Type | |
|---|---|---|
idRequired | string | – |
groupRequired | stringThe nav group it sits in; groups show in the order their first page appears. | – |
titleRequired | string | – |
leadRequired | stringThe line under the title. | – |
updated | stringAs it should read: "Sep 12, 2026". | – |
sectionsRequired | Section[] | – |
Strings18 keys for copy
Strings
copy takes any of these keys; the rest keep their defaults. A key whose text holds a value (a count, a name) takes a function.
openNavigationsearchsearchTitlesearchPlaceholdernavigationmenuTitleonThisPageupdatededitPagepaginationpreviousnexthelpfulyesnothanksYesthanksNofeedbackSentBuilt from15 components
Accessibilitylandmarks, headings, navigation
Accessibility
Docs has a main, a labelled page-tree nav that marks the current page with aria-current, a sheet for the tree on phones, code tabs that follow the kit’s Tabs keyboard pattern, and a feedback result announced in a status region. Links and buttons are real a and button elements with the kit’s focus ring.