Chat & AI
Code blocks
Accent
Scheme
Backdrop motion
Chat & AI

Code blocks

Highlight colours code with the syntax battery's tokens, in 37 languages. CodeBlock is that in a frame: a header, a copy button, a footer, built in one line or from its parts.

Highlight

A pre of coloured tokens. It follows light and dark, scrolls sideways unless told to wrap, and styles written on it reach the pre.
Text and a languageAn unknown or empty language shows the text plain, at the same size.
lang="ts"
export const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);
lang=""
export const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);
lang="diff": inserted and deleted lines
@@ -1,3 +1,3 @@
const port = 3000;
-const host = "localhost";
+const host = "0.0.0.0";
lines, start, wrapLine numbers are not part of the text: selecting the code leaves them out.
lines
wrap
start 1
const palette = { keyword: "#cf222e", string: "#0a3069", number: "#0550ae", comment: "#6e7781", function: "#8250df", type: "#953800" };
// A long comment that runs well past the right edge of the block: it scrolls sideways, or wraps under itself with its number staying at the top.
export default palette;
marksA list of {line, kind}. The line is tinted to the block's edges; added and removed get a sign in the gutter.
Line 3
import { useState } from "react";
export function Counter({ start = 0 }) {
const [count, setCount] = useState(start);
const label = "Count: " + count;
const label = `Count: ${count}`;
return (
<button onClick={() => setCount(count + 1)}>
{label}
</button>
);
}
marks
{line: 5, kind: "removed"} {line: 6, kind: "added"} {line: 8, kind: "highlighted"}
Type someThe tokens are worked out again as the text changes. Aliases are not known here: use the battery's own names (py is plain, python is coloured).
lang
def area(r):
# pi r squared
return 3.14159 * r ** 2
print(area(2))

CodeBlock

The code block of shadcn and of AI Elements. With code= it is whole in one line; without, it is the frame its parts are written in.
In one lineA header with the title (or else the language's name), a copy button, the content.
title
showLineNumbers
wrap
Counter.jsx
import { useState } from "react";
export function Counter({ start = 0 }) {
const [count, setCount] = useState(start);
const label = "Count: " + count;
const label = `Count: ${count}`;
return (
<button onClick={() => setCount(count + 1)}>
{label}
</button>
);
}
startLine=12: the marks name lines as numbered, so line 16 is the fifth.
Variants and sizesvariant: default, destructive. size: default, sm. With neither title nor language there is no header and the copy button sits over the corner.
sum.ts
export const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);
No title: the language names it
ts
export const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);
Neither: bare, the button in the corner
export const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);
CodeBlockCopyButtonCopies its value, then shows a check for two seconds. label names it; what is written under it follows the icon.
$mote build app.mote --single
With a label and words
Paste somewhere to see it: a page cannot read the clipboard back without asking.
Built from the partsHeader (title, filename, actions), content, footer. There is no context between them: the selector and the content are given the same state.
example.tsx
type Props = { label: string; tone?: "info" | "warn" };
export function Badge({ label, tone = "info" }: Props) {
const [hover, setHover] = useState<boolean>(false);
return (
<span
className={`badge badge-${tone}`}
onMouseEnter={() => setHover(true)}
>
{hover && <Icon name="star" />}
{label} &middot; {tone}
</span>
);
}
14 linesTSX
CodeBlockLanguageSelector without options lists every language; the footer counts the sample's lines.
CodeBlockLineLines of a block written by hand: plain text under each, or code= and language= to colour it. A selector with options= offers only those.
review
a line with nothing said of it
a line taken away
a line put in
a line pointed at
export const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);
variant: default, added, removed, highlightedts

Every language

The syntax battery colours 37 languages. It is not each one's whole grammar: enough to colour, outline and find things.
A sample in eachPick one. The same record feeds the chips, the selector and the block.
Line numbers
37 languages · Mote · 28 lines
sample.mote
// A list of things to do.
app "Todos" accent=#0a84ff
shape Todo
id: string
title: string
done: bool
state todos: Todo[] = [] persist
state draft = ""
derive left = todos.filter(t => !t.done).length
action add
if draft.trim() == "" return
todos.push({id: uid(), title: draft, done: false})
draft = ""
column gap=12 padding=24 max-width=480
row gap=8
Input value=draft placeholder="What next?" submit=add
Button "Add" press=add disabled=(draft == "")
for t in todos key=t.id
row gap=8 align-items=center
hover background=card
input type=checkbox checked=t.done
text t.title color=(t.done ? "dim" : "fg")
if left > 0
text `${left} left` color=dim font-size=13
esc
Pages
StartStart
Buttons & badgesComponents
Cards & disclosureComponents
Dialogs & drawersComponents
Menus & commandsComponents
Dates & tablesComponents
ChartsComponents
Chart galleryComponents
FieldsComponents
ChoicesComponents
DisplayComponents
NavigationComponents
Popovers & sheetsComponents
MessagesChat & AI
Prompt inputChat & AI
Reasoning & toolsChat & AI
Developer partsChat & AI
ConversationChat & AI
Code artifactsChat & AI
VoiceChat & AI
Code blocksChat & AI
MarkdownChat & AI
EditorElements
TerminalElements
FlowElements
3D boxesElements
PaintElements
SurfaceElements
MediaElements
IconsElements
PrimitivesElements
SQLBatteries
StorageBatteries
Net & resourcesBatteries
Crypto & bytesBatteries
ZipBatteries
TablesBatteries
PDFBatteries
TimeBatteries
ImagesBatteries
ScanBatteries
Video & audioBatteries
SearchBatteries
SyntaxBatteries
PatternsBatteries
NotifyBatteries
ShareBatteries
State & logicLanguage
WorkersLanguage
Events & elementsLanguage
StylingLanguage
RoutesLanguage
ShortcutsLanguage
Long listsLanguage
Failures & tryLanguage
Back endBack end
Models & writesBack end
Rules & failuresBack end
Jobs & schedulesBack end
Running itBack end
ExtensionsBack end
AIBack end
AnalyticsBack end
AboutAbout
↑↓move
↵open
676 places · ranked by BM25