Rocket
On this page

Examples#

These examples are small, live Rocket Pages. They are not complete example websites. Use them when you want to see one Rocket feature in a real Page file and compare the source with the rendered output.

Full example websites are still a goal. Until those exist, start with the tutorial when you want a multi-page project shape, then use these examples for focused implementation questions.

Page examples#

Example pageWhat to inspect
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.

What Each Page Shows#

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:

Choose By Task#

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.