MDX components
Every block the blog can render, with the source that makes it.
Posts here are MDX. Markdown covers the text, and components cover the rest. This page shows each one next to the source that renders it, so it doubles as a reference.
Typography
Paragraphs set at 15px with a 28px line height. Bold and italic work, as do strikethrough, inline code and links. Links to other sites open in a new tab, like the MDX docs.
A blockquote sits behind a thin rule. Use it for quotes, not for warnings. Callouts are further down.
Lists
- Unordered lists use a muted disc.
- Items can nest:
- like this one
- and this one
- Ordered lists count instead.
- Write the post.
- Read it once out loud.
- Cut a third of it.
Task lists
- Code blocks with titles
- Table of contents
- Search
Headings
Every heading gets an id and a link. Hover one to see the #. The h2 and h3 headings also appear in the table of contents on the right.
A fourth-level heading
It renders, but it stays out of the table of contents.
Tables
| Component | Built on | Interactive |
|---|---|---|
| Tabs | UI SDK | Yes |
| Accordion | UI SDK | Yes |
| Code block | Shiki | No |
| Callout | Plain JSX | No |
Wide tables scroll sideways on phones, and the column alignment from the Markdown carries over.
Code
Fences go through Shiki at build time, so Shiki never ships to the browser. The colours come from the same palette the component pages use.
import { createSignal } from "solid-js";
export const Counter = () => {
const [count, setCount] = createSignal(0);
return (
<button onClick={() => setCount(count() + 1)} type="button">
{count()}
</button>
);
};A fence without a title gets a floating copy button.
.card {
border-radius: 0.75rem;
background: oklch(1 0 0 / 4%);
}Highlights and diffs
Mark a line with a [!code highlight] comment, or show a change with [!code ++] and [!code --]. The markers vanish from the output.
export default defineConfig({
plugins: [
tanstackStart(),
nitro({ preset: "bun" }),
nitro({ cache: { driver: "fs" }, preset: "bun" }),
solid({ ssr: true }),
],
});Code tabs
Add tab="..." to consecutive fences to group them.
const [open, setOpen] = createSignal(false);Package managers
An npm fence becomes a command for each package manager. The choice sticks across the page and across visits.
npm install sugar-highCallouts
<Callout title="Heads up">The default type is `info`.</Callout>Heads up
info.Saved
Use success when something finished.
Breaking change
warn is for things that need attention before you continue.
Removed
error is for things that will not work.
idea suits tips. The title is optional.Steps
Wrap ### headings in <Steps> to number them.
Install the CLI
npx shadcn@latest initAdd a component
npx shadcn@latest add https://olekaleksander.dev/r/code-block.jsonUse it
Import it from @/components/ui/code-block and render it.
Tabs
<Tabs items={["Preview", "Notes"]}>
<Tab value="Preview">...</Tab>
<Tab value="Notes">...</Tab>
</Tabs>Tabs hold any content, including other components.
Accordion
TanStack Start, Solid 2 and Tailwind 4. The accordion itself comes from UI SDK.
Pass multiple to <Accordions>.
Yes. Closed panels use hidden="until-found", so the browser opens the one that matches.
Cards
Components
Parts of this site in Solid and React.
Blog
Everything written here, newest first.
GitHub
Source for this site and other projects.
No link
A card without href renders as a plain box.
Files
Type table
| Prop | Type | Default |
|---|---|---|
titleShown in the header and the browser tab. | string | – |
datePublish date, quoted, as YYYY-MM-DD. | string | – |
descriptionOne line under the title and in the post list. | string | – |
Inline bits
Press ⌘ K to search, once search exists. Badges label things inline: New Solid
Footnotes collect at the end of the post.1 Each one links back to where it was cited.2
Images

Live components
Any example from the components page can run inside a post.
- WarsawGMT+1
- New YorkGMT-5
- TokyoGMT+9