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
Navigate and Install
Start the Dev Server
Fire up the development server:
Open http://localhost:3000 in your browser. You should see your documentation site with sample content!
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
Inside docs/v1.0.0/, create a file called hello.mdx:
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
Let's make it more interesting with a Callout 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">12I 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">2This is helpful information for your readers.3</Callout>4<!-- -->5<Callout type="warning">6Be careful with this setting!7</Callout>Tabs for multiple options:
1<Tabs defaultValue="npm">2<Tab label="npm">3npm install specra4</Tab>5<Tab label="yarn">6yarn add specra7</Tab>8</Tabs>Steps for tutorials:
1<Steps>2<Step title="First Step">3Do this first.4</Step>5<Step title="Second Step">6Then do this.7</Step>8</Steps>Cards for visual navigation:
1<CardGrid cols={2}>2<Card3icon="zap"4title="Quick Start"5description="Get up and running fast"6href="/docs/v1.0.0/getting-started"7/>8<Card9icon="book"10title="Full Guide"11description="Complete documentation"12href="/docs/v1.0.0/guides"13/>14</CardGrid>Explore all available components in the Components section.
What's Next?
You now have a working Specra site and know the basics of creating pages. Here's where to go from here: