Components

Built-in Svelte components you can use inside .svx content.

3 min read · 552 words

Callout

Info

Use .svx instead of .md for any page that needs live components.

Tip

Frontmatter and sidecar .meta.json both work on .svx files too.

Warning

Component imports only work in .svx — plain .md files can’t have a script block.

Danger

Don’t nest a Callout inside another Callout — styling assumes one level.

Custom title

Pass title to replace the type label in the header.

Import path: #lib/components/Callout.svelte, added at the top of the .svx file’s script block alongside your other imports.

Tabs

bun install
bun run dev

Steps

Add a markdown file

Create content/example.md with frontmatter or a sidecar .meta.json.

Register it in the sidebar

Folders pick up ordering automatically from each page’s order field, so a flat page needs no extra step.

Preview it

Run bun run dev and visit /docs/example.

Cards

Card takes an optional icon prop — any name from the page icon set below.

Auto-populated

Pass auto instead of children and Cards lists the current page’s siblings — same parent, in sidebar order — pulling each one’s title, description, icon, and link from the page tree. Useful on a section’s landing page so its children never need to be listed twice.

Introduction What SVOCS is, why it exists, and how the pieces fit together. Quick Start Scaffold a project and ship your first page. Migrating to svocs Move a Fumadocs, Nextra, Docusaurus, Starlight, MkDocs, mdBook or Obsidian site to svocs: run the migration, port what it can't convert, fix dead links, and deploy. Repo Analysis Generate baseline docs content from an existing GitHub repo, heuristically or with an AI. Writing Content Frontmatter, sidecar metadata, GFM, and code blocks. Obsidian Open content/ as a vault: wikilinks, embeds, callouts, and drafts build as-is, or migrate a vault once. Navigation The _meta.json schema: ordering, titles, precedence, and category separators. Theming Pick an accent color during setup, or hand-edit the CSS custom properties directly. OG Images Every page gets a branded 1200×630 social preview card, generated at build time with no browser required. Search Five interchangeable backends behind one switch: Pagefind, Orama, FlexSearch, Typesense, and Chroma. CLI The svocs companion CLI: check a site's configuration with doctor, pull template fixes with update, convert a Fumadocs, Nextra, Docusaurus, Starlight, MkDocs, or mdBook site with migrate. Deployment Ship your SVOCS site as static files to any host. Troubleshooting Common mdsvex authoring mistakes, prerender failures, and warnings that are safe to ignore. Architecture Content pipeline, routing strategy, and theme boundaries. AI & LLMs llms.txt, llms-full.txt, and per-page raw markdown for AI tools. About What SVOCS is and where to find it.

(the grid above is live — it’s this page’s own siblings in the sidebar)

Pass of with a docs path to list another page’s children instead, for example a landing page that points into one section:

<Cards of="/docs/guides" />

Page icons

Info

Set icon: <name> in a page’s frontmatter, or icon on a _meta.json item, to show one of these next to that page in the sidebar and its <h1>. See Writing Content and Navigation.

rocket
book
gear
terminal
code
folder
file
package
zap
shield
layers
star
flag
key
lock
lightbulb
globe
target

Import PageIcon from #lib/icons/PageIcon.svelte directly if you want one inline in prose; everywhere else (frontmatter, _meta.json, the Card icon prop) just takes the name as a string.

Collapse

Why mdsvex instead of raw Markdown?

It compiles Markdown straight to Svelte components, so .svx files can mix prose with live components without a separate MDX runtime.

FileTree

  • content
    • _meta.json
    • introduction.md
    • deployment
      • index.md
      • _meta.json
  • vite.config.ts

ImageZoom

Click any screenshot to open it full-size in an overlay; click again (or press Escape) to close it:

The social preview card SVOCS generates for a page

Import path: #lib/components/ImageZoom.svelte. Takes src, alt, and optional width/height — set those two to the source image’s real dimensions so the layout doesn’t shift once it loads.

Bleed

Break wide content (a table, a diagram, a screenshot) out of the prose column’s side padding:

all-runtimes.sh
bun install     && bun run dev
pnpm install    && pnpm dev
deno task install && deno task dev

(runs across all three package managers)

That’s the full component set.

Esc

Start typing to search the docs