Getting Started
Set up and start writing documentation with Specra in under 5 minutes
Getting Started with Specra
This guide will get you from zero to a fully functional documentation site in under 5 minutes. We'll cover installation, basic configuration, and writing your first page.
Prerequisites
Before you begin, make sure you have:
- Node.js 18 or higher (check with
node --version) - A package manager: npm (comes with Node.js), yarn, or pnpm
- A code editor (VS Code recommended for MDX support)
Installation
The fastest way to get started is using create-specra, our scaffolding tool that sets up everything for you.
Create Your Project
<Tabs defaultValue="npm">
<Tab label="npm">
1npx create-specra@latest my-docs </Tab>
<Tab label="yarn">
1yarn create specra my-docs </Tab>
<Tab label="pnpm">
1pnpm create specra my-docs </Tab>
</Tabs>
This creates a new directory called `my-docs` with all the files you need to get started.
Navigate and Install
<Tabs defaultValue="npm">
<Tab label="npm">
1cd my-docs2npm install </Tab>
<Tab label="yarn">
1cd my-docs2yarn install </Tab>
<Tab label="pnpm">
1cd my-docs2pnpm install </Tab>
</Tabs>
Installation typically takes 30-60 seconds depending on your internet connection.
Start the Dev Server
<Tabs defaultValue="npm">
<Tab label="npm">
1npm run dev </Tab>
<Tab label="yarn">
1yarn dev </Tab>
<Tab label="pnpm">
1pnpm dev </Tab>
</Tabs>
Open [http://localhost:3000](http://localhost:3000) in your browser. You should see your documentation site with sample content!
<Callout type="success">
The dev server includes hot reload. Edit any MDX file and watch your changes appear instantly.
</Callout>
Project Structure
After running create-specra, here's what you get:
1my-docs/2├── src/routes/ # SvelteKit routes3│ ├── layout.tsx # Root layout with Specra providers4│ ├── page.tsx # Home page5│ └── docs/ # Documentation routes6│ └── [...slug]/ # Dynamic catch-all route7│ └── page.tsx # Doc page renderer8├── docs/ # Your documentation content9│ └── v1.0.0/ # Version folder10│ ├── about.mdx11│ ├── getting-started.mdx12│ └── guides/ # Folder grouping13│ ├── _category_.json14│ └── writing.mdx15├── public/ # Static assets (images, icons)16├── specra.config.json # Specra configuration17├── package.json18├── svelte.config.js # SvelteKit config (auto-managed)19└── tailwind.config.ts # Tailwind configurationImportant: All documentation files must use the .mdx extension, not .md. MDX lets you use React components alongside Markdown.
Your First Documentation Page
Let's create your first custom documentation page.
Create a New File
1---2title: Hello Specra3description: My first documentation page4sidebar_position: 35---6 7# Hello Specra!8 9This is my first documentation page. I can use **bold text**,10*italic text*, and even [links](https://specra-docs.com).11 12## Features I Love13 14- Fast hot reload15- Beautiful components16- Simple file structure17- Zero configuration neededView Your Page
Save the file and visit http://localhost:3000/docs/v1.0.0/hello
You should see your new page in the sidebar and rendered beautifully in the main content area.
Add a Component
1---2title: Hello Specra3description: My first documentation page4sidebar_position: 35---6 7# Hello Specra!8 9This is my first documentation page.10 11<Callout type="success">12 I just added an interactive component to my Markdown! No imports needed.13</Callout>14 15## Next Steps16 17Ready to learn more? Check out the [Components](/docs/v1.0.0/components) section.Save and watch it update instantly. Notice how you didn't need to import the Callout component - it's automatically available in all your MDX files.
Understanding Frontmatter
Frontmatter is the metadata at the top of each MDX file, wrapped in triple dashes (---). It controls how your page appears and behaves.
Available Fields
| Field | Type | Required | Description |
|---|---|---|---|
title | string | ✅ Yes | Page title shown in sidebar, browser tab, and breadcrumbs |
description | string | Recommended | Brief description for SEO and social media previews |
sidebar_position | number | No | Controls sidebar order (lower numbers appear first) |
tab_group | string | No | Assigns page to a tab group (like "guides", "api", "components") |
icon | string | No | Lucide icon name to display next to title in sidebar |
tags | array | No | Tags for categorization and filtering |
draft | boolean | No | Set to true to hide page in production builds |
last_updated | string | No | Override auto-detected last updated date |
Example Frontmatter
1---2title: Advanced Configuration3description: Deep dive into Specra configuration options4sidebar_position: 105tab_group: guides6icon: settings7tags: [configuration, advanced, customization]8draft: false9---10 11# Your content starts hereOrganizing with Folders
Group related pages into folders for better organization. Specra automatically generates navigation from your folder structure.
Basic Folder Structure
1docs/v1.0.0/2├── getting-started.mdx3├── guides/4│ ├── installation.mdx5│ ├── configuration.mdx6│ └── deployment.mdx7└── api/8 ├── overview.mdx9 └── endpoints.mdxEach folder becomes a collapsible section in the sidebar.
Category Configuration
Create a _category_.json file inside any folder to customize how it appears:
1{2 "label": "User Guides",3 "position": 2,4 "collapsible": true,5 "collapsed": false,6 "tab_group": "guides",7 "icon": "book-open"8}Options:
label: Display name in sidebar (defaults to folder name)position: Order among other folders/pagescollapsible: Whether users can collapse the sectioncollapsed: Initial collapsed statetab_group: Assign entire folder to a tab groupicon: Lucide icon name
Index Pages
Create an index.mdx file in a folder to provide a landing page when users click the folder name:
1guides/2├── _category_.json3├── index.mdx ← Landing page for /docs/v1.0.0/guides4├── installation.mdx5└── deployment.mdxUsing Components
Specra comes with a rich library of components that are automatically available in all MDX files. No imports needed.
Quick Examples
Callouts for important information:
1<Callout type="info">2 This is helpful information for your readers.3</Callout>4 5<Callout type="warning">6 Be careful with this setting!7</Callout>Tabs for multiple options:
1<Tabs defaultValue="npm">2 <Tab label="npm">3 npm install specra4 </Tab>5 <Tab label="yarn">6 yarn add specra7 </Tab>8</Tabs>Steps for tutorials:
1<Steps>2 <Step title="First Step">3 Do this first.4 </Step>5 <Step title="Second Step">6 Then do this.7 </Step>8</Steps>Cards for visual navigation:
1<CardGrid cols={2}>2 <Card3 icon="zap"4 title="Quick Start"5 description="Get up and running fast"6 href="/docs/v1.0.0/getting-started"7 />8 <Card9 icon="book"10 title="Full Guide"11 description="Complete documentation"12 href="/docs/v1.0.0/guides"13 />14</CardGrid>Explore all available components in the Components section.
Markdown Support
Specra supports all standard Markdown syntax plus GitHub Flavored Markdown extensions.
Headings: # for H1, ## for H2, etc.
Bold: **text** or __text__
Italic: *text* or _text_
Links: [text](url)
Images: 
Code: `inline code`
Code blocks: Triple backticks with language
Tables:
1| Column 1 | Column 2 |2|----------|----------|3| Data 1 | Data 2 |Task lists:
1- [x] Completed task2- [ ] Pending taskBlockquotes:
1> This is a quoteWhat's Next?
You now have a working Specra site and know the basics of creating pages. Here's where to go from here: