Welcome to the Cassiopeia documentation project! This guide will help you understand all the available components and how to use them when writing documentation.
- Getting started
- Building and running
- File structure
- Available components
- Markdown features
- Images
- Code blocks
- Best practices
- Create a new
.mdxfile insrc/content/docs/ - Add frontmatter with metadata
- Import any components you need
- Write your content
The URL is based on the filename (without extension), not the folder structure. For example:
src/content/docs/version-3.0/ios/sdk-installation.mdx→/sdk-installationsrc/content/docs/version-3.0/guides/getting-started.mdx→/getting-started
---
title: "Your Article Title"
description: "Brief description for SEO"
metadataTitle: "SEO Title | Adapty Docs"
keywords: ['keyword1', 'keyword2']
rank: 100 (default — 50)
---
import ZoomImage from '@site/src/components/ZoomImage.astro';
import Tabs from '@site/src/components/Tabs.astro';
import TabItem from '@site/src/components/TabItem.astro';
Your content goes here...npm installnpm run devOpens at http://localhost:4321. Changes auto-reload.
npm run buildOutput goes to build/ folder.
npm run previewServes the built site locally. Use this to test before deploying.
npm run build 2>&1 | grep -i errorsrc/
content/
docs/ # All documentation articles
version-3.0/
your-article.mdx
ios/
ios-guide.mdx
android/
android-guide.mdx
assets/
your-article/ # Article-specific images
image1.png
shared/ # Shared images
common-image.png
components/ # Reusable components
reusable/ # Reusable content snippets
Note: You can organize .mdx files in subfolders for better organization (e.g., by platform, topic, etc.), but the URL will always be based on the filename, not the folder path. For example, version-3.0/ios/sdk-installation.mdx will be accessible at /sdk-installation, not /ios/sdk-installation.
Display images with click-to-zoom functionality. Automatically resolves images from article folders or shared folder.
Props:
id(required): Image filenamewidth(optional): Image width, default: "700px"alt(optional): Alt text, defaults to filenameclassName(optional): Additional CSS classes
Usage:
import ZoomImage from '@site/src/components/ZoomImage.astro';
<ZoomImage id="screenshot.png" width="700px" alt="Dashboard screenshot" />Image resolution: The component automatically finds images in this order:
src/assets/{article-name}/image.png(article-specific)src/assets/shared/image.png(shared folder)- Legacy locations (for backward compatibility)
Create tabbed interfaces to organize platform-specific or alternative content.
Props for Tabs:
groupId(optional): Sync tabs across the pagequeryString(optional): Enable URL parameter sync
Props for TabItem:
value(required): Unique identifier for the tablabel(optional): Display label (defaults to value)default(optional): Set as default tab
Usage:
import Tabs from '@site/src/components/Tabs.astro';
import TabItem from '@site/src/components/TabItem.astro';
<Tabs groupId="platform">
<TabItem value="ios" label="iOS" default>
iOS-specific content here
</TabItem>
<TabItem value="android" label="Android">
Android-specific content here
</TabItem>
<TabItem value="react-native" label="React Native">
React Native content here
</TabItem>
</Tabs>Features:
- Synchronized tabs: Use the same
groupIdto sync tab selection across multiple tab groups on the same page - Persistent selection: Tab selection is saved to localStorage
- Query string support: Add
queryString={true}to enable URL parameter syncing
Create expandable/collapsible sections for additional information.
Props:
summary(required): The clickable summary textdefaultOpen(optional): Start expanded, default: false
Usage:
import Details from '@site/src/components/Details.astro';
<Details summary="Click to see more details">
Additional information that can be hidden by default.
- You can use any markdown here
- Including lists
- Code blocks
- etc.
</Details>Create hoverable tooltips that show additional information inline.
Props:
tooltip(required): The text to show in the trigger
Usage:
import InlineTooltip from '@site/src/components/InlineTooltip.astro';
This is some text with <InlineTooltip tooltip="the SDK installation guide">
[SDK documentation](sdk-installation.md)
</InlineTooltip> embedded inline.Features:
- Appears on hover
- Can be manually closed
- Supports markdown in tooltip content
Automatically generate a grid of cards linking to related documentation.
Props:
ids(optional): Array of document IDs to display
Usage:
import CustomDocCardList from '@site/src/components/CustomDocCardList.astro';
// Auto-detect child pages from sidebar
<CustomDocCardList />
// Manually specify pages
<CustomDocCardList ids={['ios-quickstart', 'android-quickstart', 'react-native-quickstart']} />A stylized button for primary actions or links to other articles. Matches the Adapty brand design.
Props (at least one is required):
id: The ID of the article to link to (e.g.,ios-sdk-installation). Links open in the same tab.href: A full URL for external links (e.g.,https://app.adapty.io). Links open in a new tab.
Usage:
// Link to another article
<Button id="ios-sdk-installation">
Install iOS SDK
</Button>
// External link
<Button href="https://app.adapty.io/registration">
Sign up for Free
</Button>Features:
- Auto-registered: You don't need to import
Buttonmanually at the top of your MDX file. - Left-aligned: The button always starts on a new line and is left-aligned.
- Responsive: Adapts styling for light and dark modes.
Use special syntax for callout boxes (note, tip, info, warning, danger):
:::note
This is a note callout with gray styling.
:::
:::tip
This is a tip callout with green styling.
:::
:::info
This is an info callout with blue styling.
:::
:::warning
This is a warning callout with yellow/amber styling.
:::
:::danger
This is a danger callout with red styling.
:::
:::important
This is an important callout (styled as warning).
:::
:::link
This callout is designed to contain a link: [Main article](main-article)
It works best with single-line content because it's vertically centered against the book icon on the left.
:::Internal links:
[View Paywalls](paywalls.md)
[Get Started](sdk-installation.md)
[Documentation](../other-doc.mdx)All .md and .mdx extensions are automatically removed during build.
External links:
[Adapty Website](https://adapty.io)Links with anchors:
[Jump to section](page.md#section-name)# H1 - Page Title (use once per page)
## H2 - Main Section
### H3 - Subsection
#### H4 - Minor SubsectionUnordered lists:
- Item 1
- Item 2
- Nested item
- Another nested item
- Item 3Ordered lists:
1. First step
2. Second step
3. Third step| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Row 1 | Data | More |
| Row 2 | Data | More |**Bold text**
*Italic text*
`inline code`import ZoomImage from '@site/src/components/ZoomImage.astro';
<ZoomImage id="screenshot.png" width="700px" alt="Description" />import Zoom from 'react-medium-image-zoom';
import 'react-medium-image-zoom/dist/styles.css';
<Zoom>
<img src={require('./img/screenshot.png').default}
style={{
border: '1px solid #727272',
width: '700px',
display: 'block',
margin: '0 auto'
}}
/>
</Zoom>Note: Both methods work, but ZoomImage is recommended for new content.
- Article-specific images →
src/assets/{article-name}/image.png - Shared images →
src/assets/shared/image.png - Legacy images → Still work from
src/content/docs/version-3.0/img/
```javascript
function example() {
return "Hello World";
}
``````javascript title="app.js"
function example() {
return "Hello World";
}
``````javascript {2,4-6}
function example() {
const highlighted = true; // This line is highlighted
const normal = true;
const alsoHighlighted = true; // Lines 4-6 highlighted
const stillHighlighted = true;
const lastHighlighted = true;
}
```- Check image exists in article folder or shared folder
- Verify filename matches exactly (case-sensitive!)
- Check file extension is included in
idprop
- Check all imports are at the top of file
- Verify component syntax is correct
- Make sure all props are valid
- Check for unclosed tags
- Component examples: Check existing articles in
src/content/docs/version-3.0/ - Component source: See
src/components/for implementation details