Interactive elements
Components that respond to reader input: editable variables, tooltips, anchors, changelog entries and copyable prompts.
Editable variables
The wc-var component creates an inline editable field. When the reader changes the value, every {{VAR_NAME}} placeholder on the page updates instantly.
Set your domain:
Set your project:
Click the variable values above and type your own to see both code blocks update.
UPPER_SNAKE_CASE. Referenced in code blocks as {{NAME}}.<wc-var name="X" value="Y" /> declares a page-level variable. See Variables and precedence.Tooltips
Add hover tooltips to provide extra context without cluttering the page. The text is keyboard focusable, Escape closes the tooltip, and it flips to stay on screen.
DocsLit uses
Read the
text is accepted as an older alias.href.top, bottom, left or right. It flips automatically when there is no room.dark or light.Anchors
Create linkable sections with auto-generated IDs:
Hovering over an anchor reveals a link icon. Readers click it to copy the direct URL to that section.
Update entries
Display changelog entries. There are two layouts. The timeline layout uses label, description and tags, and the label doubles as an anchor link. The boxed layout uses version, date and type.
--json flag for the validate command.label="2026-10-29" links as #2026-10-29. Timeline layout.added, changed, fixed, removed, deprecated or security. Boxed layout.description, then label, then date.Entry anchors
Every wc-update without an id gets one at build time from its label, or its date when it has no label. The id is lowercase, and runs of other characters become -, so "October 28, 2026" becomes october-28-2026. Duplicates on a page get -2, -3 and so on.
Tag filters
When a page has entries that use two or more distinct tags, DocsLit adds filter buttons above the first tagged entry. You don't configure them. Select one or more tags to show the entries that match any of them. Untagged entries are hidden while a filter is on, and Clear resets it. Tags match exactly, including case, so Fix and fix are different tags.
Per-page RSS feed
When url is set in docslit.json, each page that has wc-update entries also gets a <page>.rss.xml file (RSS 2.0) and a <link rel="alternate" type="application/rss+xml"> in its head. It's written for single-version sites and the default version of a versioned site.
Each entry becomes one item, in page order:
| Item field | Source |
|---|---|
| Title | rss-title, else description, else label, else date |
| Link | The page URL plus # and the entry id |
pubDate |
The label, or the date when there is no label, only if it contains a date with a 4-digit year. "October 28, 2026" qualifies and "1.4.0" doesn't. "Release 2026" counts as 1 January 2026 |
| Categories | The entry's tags |
| Description | rss-description, else a plain-text excerpt of the first 300 characters |
This feed is separate from the site-level changelog and blog feed, which is built from page frontmatter.
The site-level feed covers pages whose id starts with changelog/ or blog/, which also get RSS and Atom feeds. See What's new for a full example.
Copyable prompts
Style a prompt's parts with ::part(): body, description, actions and copy-button. See Custom CSS.
wc-prompt shows a prompt that readers can copy into an AI assistant, or open directly in one. The text between the tags is what gets copied.
Use description when the card should show a short summary and the long prompt should stay hidden. The body is then what gets copied and sent:
cursor, claude, chatgpt, claude-code and codex, or a JSON array that can also hold custom objects with label, url and icon. A {prompt} placeholder in url is replaced by the URL-encoded prompt. The Copy button is always there.A custom action uses a JSON array in single quotes: