Skip to content
Sections
Language, currently English
Rastrillo Design System

Route

The pieces that are a whole response rather than a piece of one.

Each example is live, but its links go nowhere. HTML shows the markup to copy.

error-page

The whole body of an error response: the status, one honest sentence, a way back, and 500 references an admin can use.

404: not found

Preview
<div rst-error>
  <p rst-error-status>404</p>
  <h1 rst-error-title>We can&#39;t find that page</h1>
  <p rst-error-body>The link may be out of date, or the page may have moved. Check the address, or go back to the start.</p>
  <p rst-error-cta>
    <a rst-btn="primary" href="/">Start page</a>
  </p>
</div>
{{template "error-page" dict "Status" 404 "HomeHref" "/"}}

403: forbidden

Preview
<div rst-error>
  <p rst-error-status>403</p>
  <h1 rst-error-title>You can&#39;t see this</h1>
  <p rst-error-body>Your account doesn&#39;t have access here. If you think it should, ask whoever runs this site.</p>
  <p rst-error-cta>
    <a rst-btn="primary" href="/">Start page</a>
    <a rst-btn href="/posts">Go back</a>
  </p>
</div>
{{template "error-page" dict "Status" 403 "HomeHref" "/" "BackHref" "/posts"}}

422: unprocessable

Preview
<div rst-error>
  <p rst-error-status>422</p>
  <h1 rst-error-title>That didn&#39;t go through</h1>
  <p rst-error-body>Something in what was sent wasn&#39;t right. Go back and try again; nothing was saved.</p>
  <p rst-error-cta>
    <a rst-btn="primary" href="/">Start page</a>
    <a rst-btn href="/posts/1/edit">Go back</a>
  </p>
</div>
{{template "error-page" dict
    "Status" 422
    "HomeHref" "/"
    "BackHref" "/posts/1/edit"}}

500: server error

Preview
<div rst-error>
  <p rst-error-status>500</p>
  <h1 rst-error-title>Something went wrong on our side</h1>
  <p rst-error-body>It&#39;s not you. The problem has been recorded. Try again in a moment; if it keeps happening, quote the reference below.</p>
  <p rst-error-cta>
    <a rst-btn="primary" href="/">Start page</a>
  </p>
  <p class="rst-mono" rst-error-ref dir="auto">Reference: k3f9tq</p>
</div>
{{template "error-page" dict "Status" 500 "HomeHref" "/" "Ref" "k3f9tq"}}

A 500 is the one status with a reference: an operator can grep the logs for it.

503: unavailable

Preview
<div rst-error>
  <p rst-error-status>503</p>
  <h1 rst-error-title>We&#39;re briefly unavailable</h1>
  <p rst-error-body>The site is being updated or is busy. Try again in a minute.</p>
  <p rst-error-cta>
    <a rst-btn="primary" href="/">Start page</a>
  </p>
</div>
{{template "error-page" dict "Status" 503 "HomeHref" "/"}}

Anything else: the generic pair

Preview
<div rst-error>
  <p rst-error-status>418</p>
  <h1 rst-error-title>Something&#39;s not right</h1>
  <p rst-error-body>That request couldn&#39;t be completed. Go back and try again.</p>
  <p rst-error-cta>
    <a rst-btn="primary" href="/">Start page</a>
  </p>
</div>
{{template "error-page" dict "Status" 418 "HomeHref" "/"}}

Five statuses are worded in the framework catalog. A sixth falls back to the generic pair rather than rendering a missing key's name at a reader.

back-nav

The link back up one level, above a show or edit screen.

Back to a record

Preview
<nav rst-back-nav>
  <a href="/orders/1">← Order AB3PX</a>
</nav>
{{template "back-nav" dict "Href" "/orders/1" "Label" "Order AB3PX"}}

locale-menu

The language switcher: a details menu of one-field POST forms to /_locale, so the choice lands in the locale cookie and the reader stays on the same path.

Twelve languages, current highlighted.

Preview
<details rst-dropdown rst-locale name="rst-menus">
  <summary>
    Language
    <span rst-caret aria-hidden="true">
      <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
    </span>
  </summary>
  <div rst-dropdown-menu>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="en">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="en" aria-current="true">English</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="ga">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="ga">Gaeilge</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="zh-Hans">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="zh-Hans">简体中文</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="es">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="es">Español</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="hi">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="hi">हिन्दी</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="pt-PT">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="pt-PT">Português</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="bn">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="bn">বাংলা</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="ru">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="ru">Русский</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="ja">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="ja">日本語</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="yue">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="yue">廣東話</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="vi">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="vi">Tiếng Việt</button>
    </form>
    <form method="post" action="/_locale">
      <input type="hidden" name="locale" value="ar">
      <input type="hidden" name="return" value="/">
      <button type="submit" lang="ar">العربية</button>
    </form>
  </div>
</details>
{{template "locale-menu" dict "Items" .Locales "Return" "/"}}

This one posts to /_locale, so it needs a server. Its Items come from rastrillo.LocaleItems(r). The switcher in this page's own header is the links-only version.

scheme-menu

The colour-scheme switch: a details menu of one-field POST forms to /_theme for Light, Dark and System, so the choice lands in the scheme cookie and the reader stays on the same page.

Three choices, Dark current.

Preview
<details rst-dropdown rst-scheme name="rst-menus">
  <summary>
    Colour scheme
    <span rst-caret aria-hidden="true">
      <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
    </span>
  </summary>
  <div rst-dropdown-menu role="group" aria-label="Colour scheme">
    <form method="post" action="/_theme">
      <input type="hidden" name="scheme" value="light">
      <input type="hidden" name="return" value="/">
      <button type="submit">Light</button>
    </form>
    <form method="post" action="/_theme">
      <input type="hidden" name="scheme" value="dark">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-current="true">Dark</button>
    </form>
    <form method="post" action="/_theme">
      <input type="hidden" name="scheme" value="system">
      <input type="hidden" name="return" value="/">
      <button type="submit">System</button>
    </form>
  </div>
</details>
{{template "scheme-menu" dict "Scheme" "dark" "Return" "/"}}

This one posts to /_theme, so it needs a server. Its Scheme comes from rastrillo.SchemeFrom(r); ui.ForRequest carries it. The switch in this page's own bar is the gallery's own.

api-tokens

The token page from apitoken's PageData: the one-time reveal, the create form, the list and the revoke buttons.

Four tokens, two of them live

Preview
<div rst-tokens>
  <section rst-box>
    <form rst-form method="post" action="/tokens">
      <div rst-field>
        <label rst-field-label for="agent">Agent name</label>
        <input rst-input type="text" id="agent" name="agent" maxlength="40">
      </div>
      <label rst-switch>
        <input type="checkbox" name="for_self" value="on">
        <span rst-switch-track aria-hidden="true"></span>
        This token is for me, not an agent
      </label>
      <fieldset rst-choice>
        <legend>Access</legend>
        <div rst-choice-cards>
          <label>
            <input type="radio" name="access" value="write" checked>
            <span>
              <span rst-choice-title>Read and write</span>
            </span>
          </label>
          <label>
            <input type="radio" name="access" value="read">
            <span>
              <span rst-choice-title>Read only</span>
            </span>
          </label>
        </div>
      </fieldset>
      <div rst-field>
        <label rst-field-label for="expiry">Expires</label>
        <select rst-input="short" id="expiry" name="expiry">
          <option value="30">30 days</option>
          <option value="90" selected>90 days</option>
          <option value="365">1 year</option>
          <option value="never">Never</option>
        </select>
      </div>
      <div rst-form-foot>
        <button rst-btn="primary lg" type="submit">Create token</button>
      </div>
    </form>
  </section>
  <div rst-card rst-tokens-list>
    <div rst-lrow="head">
      <span>Token</span>
      <span class="rst-m-hide">Access</span>
      <span class="rst-m-hide">Created</span>
      <span class="rst-m-hide">Last used</span>
      <span class="rst-m-hide">Expires</span>
      <span></span>
      <span></span>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Claude for Grace Hopper</span>
        <small>
          <code>k3Jx9QpL2mWa</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read and write</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span><time datetime="2026-08-11">2026-08-11</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span><time datetime="2026-10-31">2026-10-31</time></span>
      <span rst-tokens-state></span>
      <details rst-row-menu name="rst-menus">
        <summary aria-label="Actions for Claude for Grace Hopper">
          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>
        </summary>
        <div rst-row-menu-panel>
          <form method="post" action="/tokens/revoke">
            <input type="hidden" name="id" value="k3Jx9QpL2mWa">
            <button type="submit">Revoke</button>
          </form>
        </div>
      </details>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Grace Hopper</span>
        <small>
          <code>Qm2vR8sT4xYb</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read only</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span>Never</span>
      <span rst-tokens-state></span>
      <details rst-row-menu name="rst-menus">
        <summary aria-label="Actions for Grace Hopper">
          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>
        </summary>
        <div rst-row-menu-panel>
          <form method="post" action="/tokens/revoke">
            <input type="hidden" name="id" value="Qm2vR8sT4xYb">
            <button type="submit">Revoke</button>
          </form>
        </div>
      </details>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Codex for Grace Hopper</span>
        <small>
          <code>Zp7wN1cH6kLd</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read and write</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span>Never</span>
      <span rst-tokens-state><span rst-status rst-tone="neutral">Revoked</span></span>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Nightly import for Grace Hopper</span>
        <small>
          <code>Vb4tG9yK3nMe</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read only</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span><time datetime="2026-08-11">2026-08-11</time></span>
      <span rst-tokens-state><span rst-status rst-tone="warning">Expired</span></span>
    </div>
  </div>
  <div rst-tokens-revoke>
    <form method="post" action="/tokens/revoke-agent">
      <input type="hidden" name="agent" value="Claude">
      <button rst-btn type="submit">Revoke all for this agent: Claude</button>
    </form>
    <form method="post" action="/tokens/revoke-all">
      <button rst-btn="danger" type="submit">Revoke all tokens</button>
    </form>
  </div>
</div>
{{template "api-tokens" dict "Page" .Page "Path" "/tokens"}}

Pass what Handlers hand Render as Page, and the page's own path as Path. The revoke forms post to Path/revoke, Path/revoke-agent and Path/revoke-all; set RevokePath, RevokeAgentPath or RevokeAllPath to change one.

Just created: the secret, shown once

Preview
<div rst-tokens>
  <div rst-callout rst-tone="positive" tabindex="-1" autofocus>
    <span rst-callout-ic aria-hidden="true">
      <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>
    </span>
    <div rst-callout-body>
      <strong>Copy this token now. It won&#39;t be shown again.</strong>
      <p>
        <code rst-tokens-secret>harbour_k3Jx9QpL2mWa_6bD2qK9xWz4rT8vN1mP3sL7yF5hJ0cG2aE4uB</code>
      </p>
    </div>
  </div>
  <section rst-box>
    <form rst-form method="post" action="/tokens">
      <div rst-field>
        <label rst-field-label for="agent">Agent name</label>
        <input rst-input type="text" id="agent" name="agent" maxlength="40">
      </div>
      <label rst-switch>
        <input type="checkbox" name="for_self" value="on">
        <span rst-switch-track aria-hidden="true"></span>
        This token is for me, not an agent
      </label>
      <fieldset rst-choice>
        <legend>Access</legend>
        <div rst-choice-cards>
          <label>
            <input type="radio" name="access" value="write" checked>
            <span>
              <span rst-choice-title>Read and write</span>
            </span>
          </label>
          <label>
            <input type="radio" name="access" value="read">
            <span>
              <span rst-choice-title>Read only</span>
            </span>
          </label>
        </div>
      </fieldset>
      <div rst-field>
        <label rst-field-label for="expiry">Expires</label>
        <select rst-input="short" id="expiry" name="expiry">
          <option value="30">30 days</option>
          <option value="90" selected>90 days</option>
          <option value="365">1 year</option>
          <option value="never">Never</option>
        </select>
      </div>
      <div rst-form-foot>
        <button rst-btn="primary lg" type="submit">Create token</button>
      </div>
    </form>
  </section>
  <div rst-card rst-tokens-list>
    <div rst-lrow="head">
      <span>Token</span>
      <span class="rst-m-hide">Access</span>
      <span class="rst-m-hide">Created</span>
      <span class="rst-m-hide">Last used</span>
      <span class="rst-m-hide">Expires</span>
      <span></span>
      <span></span>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Claude for Grace Hopper</span>
        <small>
          <code>k3Jx9QpL2mWa</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read and write</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span><time datetime="2026-08-11">2026-08-11</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span><time datetime="2026-10-31">2026-10-31</time></span>
      <span rst-tokens-state></span>
      <details rst-row-menu name="rst-menus">
        <summary aria-label="Actions for Claude for Grace Hopper">
          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>
        </summary>
        <div rst-row-menu-panel>
          <form method="post" action="/tokens/revoke">
            <input type="hidden" name="id" value="k3Jx9QpL2mWa">
            <button type="submit">Revoke</button>
          </form>
        </div>
      </details>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Grace Hopper</span>
        <small>
          <code>Qm2vR8sT4xYb</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read only</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span>Never</span>
      <span rst-tokens-state></span>
      <details rst-row-menu name="rst-menus">
        <summary aria-label="Actions for Grace Hopper">
          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>
        </summary>
        <div rst-row-menu-panel>
          <form method="post" action="/tokens/revoke">
            <input type="hidden" name="id" value="Qm2vR8sT4xYb">
            <button type="submit">Revoke</button>
          </form>
        </div>
      </details>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Codex for Grace Hopper</span>
        <small>
          <code>Zp7wN1cH6kLd</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read and write</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span>Never</span>
      <span rst-tokens-state><span rst-status rst-tone="neutral">Revoked</span></span>
    </div>
    <div rst-lrow>
      <span class="rst-nm"><span rst-actor>Nightly import for Grace Hopper</span>
        <small>
          <code>Vb4tG9yK3nMe</code>
        </small>
      </span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Access</span>Read only</span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Created</span><time datetime="2026-08-02">2026-08-02</time></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Last used</span></span>
      <span rst-tokens-fact><span rst-tokens-fact-label>Expires</span><time datetime="2026-08-11">2026-08-11</time></span>
      <span rst-tokens-state><span rst-status rst-tone="warning">Expired</span></span>
    </div>
  </div>
  <div rst-tokens-revoke>
    <form method="post" action="/tokens/revoke-agent">
      <input type="hidden" name="agent" value="Claude">
      <button rst-btn type="submit">Revoke all for this agent: Claude</button>
    </form>
    <form method="post" action="/tokens/revoke-all">
      <button rst-btn="danger" type="submit">Revoke all tokens</button>
    </form>
  </div>
</div>
{{template "api-tokens" dict "Page" .Page "Path" "/tokens"}}

Render the create form's response with Created set, and do not redirect it: the secret is in that response and nowhere else.

No tokens yet

Preview
<div rst-tokens>
  <section rst-box>
    <form rst-form method="post" action="/tokens">
      <div rst-field>
        <label rst-field-label for="agent">Agent name</label>
        <input rst-input type="text" id="agent" name="agent" maxlength="40">
      </div>
      <label rst-switch>
        <input type="checkbox" name="for_self" value="on">
        <span rst-switch-track aria-hidden="true"></span>
        This token is for me, not an agent
      </label>
      <fieldset rst-choice>
        <legend>Access</legend>
        <div rst-choice-cards>
          <label>
            <input type="radio" name="access" value="write" checked>
            <span>
              <span rst-choice-title>Read and write</span>
            </span>
          </label>
          <label>
            <input type="radio" name="access" value="read">
            <span>
              <span rst-choice-title>Read only</span>
            </span>
          </label>
        </div>
      </fieldset>
      <div rst-field>
        <label rst-field-label for="expiry">Expires</label>
        <select rst-input="short" id="expiry" name="expiry">
          <option value="30">30 days</option>
          <option value="90" selected>90 days</option>
          <option value="365">1 year</option>
          <option value="never">Never</option>
        </select>
      </div>
      <div rst-form-foot>
        <button rst-btn="primary lg" type="submit">Create token</button>
      </div>
    </form>
  </section>
  <div rst-empty>
    <p rst-empty-body>No tokens yet.</p>
  </div>
</div>
{{template "api-tokens" dict "Page" .Page "Path" "/tokens"}}