Skip to content

Component gallery

  1. Content
  2. Code

Primitives

  • Buttons30
  • Badges21
  • Keys4
  • Status8
  • Avatars8
  • Alerts4
  • Cards10
  • Dropdowns4
  • Corner windows3
  • Dialogs7
  • Windows4
  • Taskbar1
  • Launcher1
  • Desk icons1
  • Progress8
  • Scroll cues2

Forms

  • Toggles5
  • Selects3
  • Inputs8
  • Textareas7
  • Segmented controls4
  • Attachments18

Content

  • Quotes5
  • Stats5
  • Heatmap3
  • Icon lists2
  • Masonry2
  • Accordion2
  • Code8
  • Contact methods7

Chat

  • Messages22
  • Posts29

Showcase

  • Media cards4
  • Logos1
  • 88x31s15
  • Carousel3
  • Blueprint frames2
  • Card grids3

Media

  • Figures4
  • Audio player4
  • Media player3
  • Radio5
  • Shorts2

Toys

  • Terminal4
  • Destructor1
  • Status board7

Sections

  • Section3
  • Side hero2
  • Navbar5
  • Footer1
  • Sidebar2

Display

ThemeT
Mode
Mode
M
Style
Style
Y
Spacing
Spacing
Radius
Radius
Font size
Font size
Compare
Compare
Effects
S

ShortcutsAlt+Shift+key

Components

Primitives

  • Buttons30
  • Badges21
  • Keys4
  • Status8
  • Avatars8
  • Alerts4
  • Cards10
  • Dropdowns4
  • Corner windows3
  • Dialogs7
  • Windows4
  • Taskbar1
  • Launcher1
  • Desk icons1
  • Progress8
  • Scroll cues2

Forms

  • Toggles5
  • Selects3
  • Inputs8
  • Textareas7
  • Segmented controls4
  • Attachments18

Content

  • Quotes5
  • Stats5
  • Heatmap3
  • Icon lists2
  • Masonry2
  • Accordion2
  • Code8
  • Contact methods7

Chat

  • Messages22
  • Posts29

Showcase

  • Media cards4
  • Logos1
  • 88x31s15
  • Carousel3
  • Blueprint frames2
  • Card grids3

Media

  • Figures4
  • Audio player4
  • Media player3
  • Radio5
  • Shorts2

Toys

  • Terminal4
  • Destructor1
  • Status board7

Sections

  • Section3
  • Side hero2
  • Navbar5
  • Footer1
  • Sidebar2

Content · 7 of 8

Code

Highlighted at build time by Shiki, in the palette's colors. The copy button needs JS and is absent without it.

packages/ui/src/astro/blocks/code.astro8 stories

Preview settings
Width
Preview width
Stage
Stage
typescript
Props of typescript
<Code code="/** Writes the pointer position on each subscriber, once a frame. */\nexport con…" lang="ts" title="src/lib/pointer.ts" />
Open code/typescript on its own
src/lib/pointer.tsts
/** Writes the pointer position on each subscriber, once a frame. */
export const track = (targets: HTMLElement[]) => {
    let raf = 0;
    addEventListener("pointermove", (event) => {
        if (event.pointerType !== "mouse") return; // touch has no hover
        raf ||= requestAnimationFrame(() => {
            raf = 0;
            for (const el of targets) el.style.setProperty("--x", `${event.clientX}`);
        });
    });
};
astro-numbered
Props of astro-numbered
<Code code="---\nimport Button from \"../components/ui/button.astro\";\n\nconst { label = \"Save\"…" lang="astro" title="save.astro" lineNumbers />
Open code/astro-numbered on its own
save.astroastro
---
import Button from "../components/ui/button.astro";

const { label = "Save" } = Astro.props;
---

<form method="post">
    <Button type="submit">{label}</Button>
</form>
css
Props of css
<Code code=".card {\n    padding: var(--space-md);\n    border: 1px solid var(--color-border)…" lang="css" />
Open code/css on its own
css
.card {
    padding: var(--space-md);
    border: 1px solid var(--color-border);

    &:hover {
        border-color: var(--color-primary);
    }
}
shell
Props of shell
<Code code="$ deno run build\n✓ Completed in 1.2s\n$ deno run check" lang="shellsession" />
Open code/shell on its own
shellsession
$ deno run build
✓ Completed in 1.2s
$ deno run check
wrap
Props of wrap
<Code code="const message = \"A line long enough that it runs past the edge of the block, wh…" lang="js" wrap />
Open code/wrap on its own
js
const message = "A line long enough that it runs past the edge of the block, which shows whether it wraps or scrolls";
scroll
Props of scroll
<Code code="const message = \"A line long enough that it runs past the edge of the block, wh…" lang="js" />
Open code/scroll on its own
js
const message = "A line long enough that it runs past the edge of the block, which shows whether it wraps or scrolls";
plain
Props of plain
<Code code="No language: plain text." />
Open code/plain on its own
plaintext
No language: plain text.
inline
Props of inline
<Code code="font: var(--type-code)" lang="css" inline />
Open code/inline on its own
font: var(--type-code)
PreviousAccordionNextContact methods