Rocket
On this page

Examples#

Examples are live, complete patterns you can compare against your own Rocket project. Use them after the tutorial path when you want to see one feature working in context.

For relaunch, Rocket needs three polished public examples: a marketing site, component-library docs, and an AI-generated site from a brief. The examples below are the current feature examples that support that launch set.

Available examples#

ExampleWhat it proves
Web Awesome ComponentsMarkdown Pages can use package Web Components through Rocket registration.
Component Showcase With DemosComponent documentation can include rendered demos beside source.
Server Time PageJavaScript Pages can run at request time when static output is not enough.
JavaScript Pages With LayoutsStatic and server-rendered JavaScript Pages can share docs layout code.
API OutputJavaScript Pages can emit machine-readable static output.

Feature examples#

Web Awesome Components#

Use Web Awesome custom elements in a Markdown Page with Rocket's component registration model.

This example covers:

Component Showcase With Demos#

Use js demo blocks to document Web Awesome's <wa-details> component with JavaScript Demos and source code.

This example covers:

Server Time Page#

Render a request-time JavaScript Page that shows the current server timestamp and request details.

This example covers:

JavaScript Pages With Layouts#

Use the docs layout from static and server-rendered JavaScript Pages without constructing PageData by hand.

This example covers:

API Output#

Return JSON from a JavaScript Page and build it as a static file output.

This example covers:

Choosing an example#

Start with Web Awesome Components when the Page is mostly Markdown and needs package components.

Use Component Showcase With Demos when a Page documents component usage, variants, states, and interactive behavior.

Use Server Time Page when you need a minimal working .rocket.js Page.

Use JavaScript Pages With Layouts when a JavaScript Page should still look like the rest of the docs site, whether it renders once at build time or runs at request time.

Use API Output when a JavaScript Page should return machine-readable JSON instead of an HTML document.