Design System
Playground Zur Vorlage

Komponenten · InhaltCode-Block

Komponente · 6 Varianten

Code-Block

components/CodeBlockProse.astro

v2: Zeilen ohne Leerraum (set:html). Code für Artikel: Haarlinien-Rahmen, Fond, Mono sm. Dateiname, Zeilennummern, Kopieren, Diff-Zeile in Oliv-Fond, inline nw-code.

Notizen

  • Bestand: CodeBlock als Docs-Werkzeug (components/system), nw-code inline.
  • Diff-Zeile ist der einzige Oliv-Fond hier: oliv-100 / oliv-900, sehr leise. Zu prüfen.

Props

Name Typ Default Notiz
variant "schlicht" | "datei" | "zeilen" | "kopieren" | "diff" | "inline" "schlicht" 01–06.
surface "nacht" | "paper" "nacht" Pflicht-Paar.
<CodeBlockProse variant="schlicht" surface="nacht" />

01 · Schlicht

Rahmen, Fond

Docs CodeBlock. Basis.

Nacht

<Button variant="primary" text="Slot anfragen" /><Tag text="Index" index="01" /><SectionLabel text="Warum wir" />

Paper

<Button variant="primary" text="Slot anfragen" /><Tag text="Index" index="01" /><SectionLabel text="Warum wir" />

02 · Datei

Kopfzeile mit Pfad

Docs. Mono xs.

Nacht

src/pages/index.astro
<Button variant="primary" text="Slot anfragen" /><Tag text="Index" index="01" /><SectionLabel text="Warum wir" />

Paper

src/pages/index.astro
<Button variant="primary" text="Slot anfragen" /><Tag text="Index" index="01" /><SectionLabel text="Warum wir" />

03 · Zeilen

Nummern links

Anfrage. select-none.

Nacht

1<Button variant="primary" text="Slot anfragen" />2<Tag text="Index" index="01" />3<SectionLabel text="Warum wir" />

Paper

1<Button variant="primary" text="Slot anfragen" />2<Tag text="Index" index="01" />3<SectionLabel text="Warum wir" />

04 · Kopieren

Button im Kopf

Anfrage. Clipboard, 1,5 s Rückmeldung.

Nacht

src/pages/index.astro
<Button variant="primary" text="Slot anfragen" /><Tag text="Index" index="01" /><SectionLabel text="Warum wir" />

Paper

src/pages/index.astro
<Button variant="primary" text="Slot anfragen" /><Tag text="Index" index="01" /><SectionLabel text="Warum wir" />

05 · Diff

+ Zeile in Oliv

Git. Kein Grün.

Nacht

 <Button variant="primary" text="Slot anfragen" />+<Tag text="Index" index="01" /> <SectionLabel text="Warum wir" />

Paper

 <Button variant="primary" text="Slot anfragen" />+<Tag text="Index" index="01" /> <SectionLabel text="Warum wir" />

06 · Inline

nw-code im Satz

Typografie. Bestand gezeigt.

Nacht

Im Satz bleibt Code nw-code, Mono auf Fond, keine Kante.

Paper

Im Satz bleibt Code nw-code, Mono auf Fond, keine Kante.