Markdown View

@sushindustries/ui

Renders Markdown with callouts, CSS-only tabs, custom blocks and highlighted code.

5 min read
View as MarkdownEdit on GitHub

Renders a whole Markdown document - headings, callouts, CSS-only tabs, custom blocks and highlighted code - as the template layer every content file on this site is written against. Reach for it wherever raw Markdown, not JSX, needs to become a page: posts, component docs, package READMEs.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/markdown-view.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/markdown-view.json

Why it is built this way

Content on this site is .md, not TSX, which only works if Markdown can reach past paragraphs and lists - the docs extensions add callouts and tabbed sections, and blocks lets a page map a comment-fenced block to a live React component without this package knowing what that component is. Parsing and syntax highlighting both run synchronously, so a whole document renders during SSR with no client JavaScript and nothing to re-highlight on hydration.

The parser's trust boundary is what makes rendering author content safe at all: it emits a bounded AST rather than passing raw HTML through, so a document cannot inject markup.

What it does not do

An unmatched block name or reference mention is not an error - it falls back quietly, rendering its children as plain prose or plain <code>. That is deliberate but it means a typo in a block's name looks identical to the block doing nothing.

Install commands are not written here

Anything in packages/ui/registry.ts gets its TanStack and shadcn commands attached automatically, so there is nothing to keep in sync.

Install

tanstack add https://adamjurek.com/r/tanstack/markdown-view.json
shell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/markdown-view.json
shell
pnpm add @sushindustries/ui @sushindustries/atoms
shell

What you get

Version0.1.0
Categorycontent · Rendering
Filesmarkdown-view.tsx, markdown-blocks.tsx
Dependencies@tanstack/markdown@0.0.13
Also installscode-blockCode BlockA highlighted code slab with the CLI's colours, a lit top edge, and a copy button that confirms in place.@sushindustries/ui · content, referenceReferenceAn inline mention that carries a hover card: title, summary and meta for the thing it names, raised by CSS alone.@sushindustries/ui · content
Tagsmarkdown, highlight, ssr
UsesCode BlockCode BlockA highlighted code slab with the CLI's colours, a lit top edge, and a copy button that confirms in place.@sushindustries/ui · contentReferenceReferenceAn inline mention that carries a hover card: title, summary and meta for the thing it names, raised by CSS alone.@sushindustries/ui · content