# Components

Pages are written in MDX. The [editor](https://docs.rimfe.com/platform/editor) inserts each of these from the `/` menu, and the text below is what it saves. Anything outside this list fails the build with the page and the line.

## Callouts

Six tones. A callout takes an optional title.

<Callout tone="note" title="Note">
  Background the reader can skip.
</Callout>

<Callout tone="tip">
  A faster or safer way to do the step above.
</Callout>

<Callout tone="info">
  Context that explains why something behaves the way it does.
</Callout>

<Callout tone="check">
  What the reader should see when the step worked.
</Callout>

<Callout tone="warning" title="Before you continue">
  Something that is easy to get wrong and costs time to undo.
</Callout>

<Callout tone="danger">
  An action that deletes data or cannot be undone.
</Callout>

```mdx
<Callout tone="warning" title="Before you continue">
  Something that is easy to get wrong and costs time to undo.
</Callout>
```

## Steps

<Steps>
  <Step title="Install the package" id="install">
    ```bash
    npm install example-sdk
    ```
  </Step>
  <Step title="Set your key">
    Put the key in `EXAMPLE_API_KEY`. The client reads it on start.
  </Step>
  <Step title="Send the first request">
    A `200` response means the key works.
  </Step>
</Steps>

```mdx
<Steps>
  <Step title="Install the package" id="install">
    ...
  </Step>
</Steps>
```

Each titled step is listed with its number under **On this page**. Its anchor is the title as a slug, or the `id` you set: [`#install`](#install) scrolls to it. Ids are letters, digits, `-` and `_`, and each is used once per page.

## Code

A code block takes a title, highlighted lines and line numbers. Mintlify's `highlight={3-4}` and `lines` work too.

```ts title="src/client.ts" {3-4} showLineNumbers
import { createClient } from "example-sdk";

const client = createClient({
  apiKey: process.env.EXAMPLE_API_KEY,
});

export const invoices = await client.invoices.list({ limit: 10 });
```

````mdx
```ts title="src/client.ts" {3-4} showLineNumbers
const client = createClient();
```
````

Every block has a copy button. When a line runs past the edge, the block fades at the right and shows a wrap button.

### Added and removed lines

End a line with a `[!code ++]` or `[!code --]` comment. The comment is not shown, and copying leaves the removed lines out.

```diff
-const client = createClient({ region: "eu" });
+const client = createClient({ region: "us" });
```

````mdx
```ts
const client = createClient({ region: "eu" }); // [!code --]
const client = createClient({ region: "us" }); // [!code ++]
```
````

`[!code highlight]` highlights a line the same way. Add a count to cover the next lines too: `[!code ++:3]`. A comment that holds only the marker applies to the line below it.

### Focus

Focus dims the other lines until the reader points at the block. Use `focus={2-3}` or a `[!code focus]` comment.

```ts focus={3-5}
import { createClient } from "example-sdk";

const client = createClient({
  apiKey: process.env.EXAMPLE_API_KEY,
});
```

````mdx
```ts focus={3-5}
```
````

### Long blocks

`expandable` shows the first ten lines of a long block and a button to show the rest.

```yaml title="example.config.yaml" expandable
name: acme-docs
region: us
build:
  command: npm run build
  output: dist
  cache: true
routes:
  - path: /
    page: home
  - path: /guides
    page: guides
  - path: /reference
    page: reference
  - path: /changelog
    page: changelog
redirects:
  - from: /docs
    to: /guides
```

````mdx
```yaml title="example.config.yaml" expandable
```
````

### Wrap

`wrap` wraps long lines instead of scrolling them.

```ts wrap
export const message = "Wrapped lines stay readable on a phone, so the reader never scrolls sideways to read the end of a long string.";
```

````mdx
```ts wrap
```
````

### Terminal

A shell block (`bash`, `sh`, `zsh`, `console`, `powershell`, `cmd`) without a title gets a terminal bar. To show a command running, with its prompts and choices, use a [terminal illustration](#terminal-illustrations).

```bash
example deploy --env production
```

### Package managers

Write the npm command once. `package-install`, or `npm2yarn` on any fence, shows it for npm, pnpm, yarn and bun. Picking a package manager switches every block on the page.

```package-install
npm install -D example-sdk
```

````mdx
```package-install
npm install -D example-sdk
```
````

### Code tabs

The same example in several languages. The reader's choice is remembered across pages.

<CodeTabs>
```ts title="TypeScript"
const invoices = await client.invoices.list();
```

```python title="Python"
invoices = client.invoices.list()
```

```go title="Go"
invoices, err := client.Invoices.List(ctx)
```
</CodeTabs>

With `dropdown`, a menu picks the example instead of a row of tabs.

<CodeTabs dropdown>
```ts title="TypeScript"
const invoices = await client.invoices.list();
```

```python title="Python"
invoices = client.invoices.list()
```
</CodeTabs>

````mdx
<CodeTabs dropdown>
```ts title="TypeScript"
const invoices = await client.invoices.list();
```
</CodeTabs>
````

## Tabs

<Tabs>
  <Tab title="macOS">
    Download the `.dmg` and drag the app to **Applications**.
  </Tab>
  <Tab title="Linux">
    Install with your package manager, then run `example --version`.
  </Tab>
  <Tab title="Windows">
    Run the installer. It adds `example` to your `PATH`.
  </Tab>
</Tabs>

Tab sets with the same tabs follow one choice: pick Linux here and every macOS, Linux and Windows set on the page switches, and the choice is remembered. Picking a tab puts it in the address, so a link such as [`#tab-linux`](#tab-linux) opens that tab. `sync={false}` keeps a set on its own.

```mdx
<Tabs sync={false}>
  <Tab title="macOS">
    ...
  </Tab>
</Tabs>
```

## Cards

A card takes a title, a link, an [icon](#icons) and a short body.

<Cards>
  <Card title="Quickstart" href="https://docs.rimfe.com/quickstart" icon="rocket">
    Install the GitHub App and get a first check.
  </Card>
  <Card title="Configuration" href="https://docs.rimfe.com/configuration" icon="sliders-horizontal">
    Point Rimfe at your docs and choose when it runs.
  </Card>
  <Card title="Reference" href="https://docs.rimfe.com/reference/formats" icon="book-open">
    Formats, limits and permissions.
  </Card>
  <Card title="Troubleshooting" href="https://docs.rimfe.com/troubleshooting" icon="life-buoy">
    Fix a missing check or an empty review.
  </Card>
</Cards>

```mdx
<Cards>
  <Card title="Quickstart" href="/quickstart" icon="rocket">
    Install the GitHub App and get a first check.
  </Card>
</Cards>
```

`horizontal` puts the icon beside the text, `cta` adds a line of link text under the body, and `arrow` marks the card as a link.

<Card title="Editor" href="https://docs.rimfe.com/platform/editor" icon="pencil" horizontal cta="Open the guide" arrow>
  Write and publish pages without a repository.
</Card>

```mdx
<Card title="Editor" href="/platform/editor" icon="pencil" horizontal cta="Open the guide" arrow>
  Write and publish pages without a repository.
</Card>
```

## Buttons

A link drawn as a button. Buttons on a line of their own sit side by side.

<Button href="https://docs.rimfe.com/quickstart">Get started</Button> <Button href="https://docs.rimfe.com/platform/editor" variant="secondary">Open the editor</Button>

```mdx
<Button href="/quickstart">Get started</Button> <Button href="/platform/editor" variant="secondary">Open the editor</Button>
```

Links are checked like every other link, and a link to another site opens in a new tab.

## Downloads

A file row with the type, the name and the size. `href` is a file in the site or an `https://` address.

<Download href="https://docs.rimfe.com/assets/afdaadac719ebd15a30ce836e520129f617d0c369adf6c8a0e6d5d61b4bec93b.json" title="Example site config" />

```mdx
<Download href="/files/rimfe-docs.example.json" title="Example site config" />
```

## FAQ

Questions and answers, shown like accordions. The page also tells search engines about them, once for the whole page.

<Faq>
  <FaqItem question="Do readers need an account?">
    No. Public sites are open to everyone.
  </FaqItem>
  <FaqItem question="Can I move my pages out later?">
    Yes. Every page downloads as MDX.
  </FaqItem>
</Faq>

```mdx
<Faq>
  <FaqItem question="Do readers need an account?">
    No. Public sites are open to everyone.
  </FaqItem>
</Faq>
```

## Diagrams

A code block in the `mermaid` language is drawn as a diagram when the site is built. It follows the reader's light or dark theme. Flowcharts, sequence, state, class and entity diagrams are supported.

```mermaid title="A review, from pull request to result"
flowchart LR
  PR[Pull request] --> Map[Find affected docs]
  Map --> Check{Still correct?}
  Check -->|Yes| Pass[Check passes]
  Check -->|No| Fix[Finding and fix]
```

```mermaid
sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub
  participant R as Rimfe
  Dev->>GH: Open pull request
  GH->>R: Webhook
  R->>R: Compare the change with the docs
  R-->>GH: Check result and comment
  GH-->>Dev: Review the suggested fix
```

````mdx
```mermaid title="A review, from pull request to result"
flowchart LR
  PR[Pull request] --> Map[Find affected docs]
```
````

Readers can zoom and pan a large diagram. The buttons in its corner zoom in, zoom out, reset and open it full screen. Drag to move it. Ctrl or Cmd with the scroll wheel zooms, or a pinch on a phone. A focused diagram also takes `+`, `-`, `0` and the arrow keys.

## Charts

The same block draws bar and line charts from a short list of numbers.

```mermaid title="Pages checked each week"
xychart-beta
  x-axis [Week 1, Week 2, Week 3, Week 4, Week 5, Week 6]
  y-axis "Pages" 0 --> 120
  bar [24, 38, 61, 74, 92, 108]
  line [20, 35, 55, 70, 88, 104]
```

## File trees

A code block in the `tree` language is shown as folders and files. Indent to nest, end a folder with `/`, and add a note after `#`.

```tree title="A docs folder"
docs/
  index.mdx          # the home page
  guides/
    install.mdx
    deploy.mdx
  reference/
    cli.mdx
  meta.json          # the order of the sidebar
```

````mdx
```tree title="A docs folder"
docs/
  index.mdx          # the home page
  guides/
    install.mdx
```
````

## Math

Write LaTeX between dollar signs. One `$` on each side keeps a formula in the line, such as $e^{i\pi} + 1 = 0$. Two on their own lines make a formula of its own:

$$
\int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}
$$

```mdx
The area is $\pi r^2$.

$$
\int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}
$$
```

Formulas are typeset when the site is built, so pages load no math script. Prices stay text: "$5 and $10" is not a formula, because a `$` followed by a space or a digit after the closing one does not count. Write `\$` for a dollar sign that would otherwise start one. A formula with a mistake fails with a build warning on its line, and readers see its LaTeX.

## Images

An image can have a version for dark mode. Readers see the one that matches their theme, and only that one loads.

```mdx
<img src="/images/dashboard.png" darkSrc="/images/dashboard-dark.png" alt="The dashboard" width={900} height={560} />
```

Mintlify's pair of images with `className="block dark:hidden"` and `className="hidden dark:block"` reads as one image with a dark version. In the editor, choose **Add dark version** on an image.

## Variables

Values you use on many pages, such as a product name or the latest version, live in **Settings**, under **Variables**. Write `{{name}}` in a page to show one. It works in text, links, component attributes and code blocks, and changing the value updates every page on the next build.

```mdx
Install version {{version}} of the [{{product}} CLI](https://{{domain}}/cli).
```

A site holds up to 50 variables. A name starts with a letter or `_` and uses letters, digits and `_`. A value is one line of up to 200 characters, and it always shows as text. A name with no value stays as written, with a build warning on its line. Write `\{{name}}` to show the braces themselves. Page titles and descriptions are not filled in.

## Snippets

Text you repeat on several pages can live in one file and be included where it is needed. Keep snippets in a folder whose name starts with `_`, such as `_snippets`, so they are not pages of their own.

```mdx
<include plan="Pro" seats={10}>/_snippets/plan.mdx</include>
```

Values passed this way fill `{{plan}}` and `{{seats}}` in the snippet, ahead of site variables of the same name. A snippet can include another, up to three levels deep. One page shows at most 200 includes and 1,000,000 characters of included text; the rest are left out with a build warning. Mintlify snippets with props come in this way when you [import](https://docs.rimfe.com/platform/import-and-export) a site.

## Tables

| Setting | Default | What it does |
| --- | --- | --- |
| `visibility` | `public` | Who can open the site. |
| `checkSchedule` | `weekly` | How often pages are checked against the code. |
| `feedback` | `on` | Shows "Was this page helpful?" under each page. |

## Fields

A field documents one parameter, option or response value: the name, its type, where it is sent, whether it is required or deprecated and its default, with the description under it. `location` is `path`, `query`, `body` or `header`. Each field gets its own link from its name.

<Field name="limit" type="number" default="20" location="query">
How many invoices to return, from 1 to 100.
</Field>

<Field name="customer" type="string" required location="query">
The customer the invoices belong to.
</Field>

<Field name="starting_after" type="string" deprecated location="query">
Use `cursor` instead.
</Field>

<Field name="invoice" type="object">
The invoice that was created.

<Expandable title="properties">
<Field name="id" type="string" required>
The invoice id.
</Field>

<Field name="status" type="string">
`draft`, `open` or `paid`.
</Field>
</Expandable>
</Field>

```mdx
<Field name="limit" type="number" default="20" location="query">
How many invoices to return, from 1 to 100.
</Field>

<Field name="invoice" type="object">
The invoice that was created.

<Expandable title="properties">
<Field name="id" type="string" required>
The invoice id.
</Field>
</Expandable>
</Field>
```

`<Expandable>` nests fields under their parent and stays closed until a reader opens it; add `defaultOpen` to start it open. Pages imported from Mintlify keep their `<ParamField>` and `<ResponseField>` components as they are.

## Checklists

Wrap a task list in `<Checklist>` and readers can tick items off. Ticks stay in the reader's browser, and items written as `- [x]` start ticked. Give the list an `id` so ticks stay with it when lists are added or moved on the page.

<Checklist id="first-site">
- [ ] Connect a repository
- [ ] Pick the docs folder
- [ ] Publish the site
</Checklist>

```mdx
<Checklist id="first-site">
- [ ] Connect a repository
- [ ] Pick the docs folder
</Checklist>
```

A task list outside a checklist is shown as written, without boxes to tick.

## Prompts

A prompt shows text readers paste into an AI assistant, exactly as written. Long prompts fold after about eight lines with a button to show the rest. `actions` picks the buttons: `copy` (the default) and `cursor`, which opens the prompt in Cursor for the reader to review. Leave `cursor` out of the site's page menu to hide it on every prompt.

Add search to an acme project

```text
Add full-text search to the widgets list in this project.

- Use the existing `listWidgets` query.
- Add one test for an empty result.
```

```mdx
<Prompt description="Add search to an acme project" actions={["copy", "cursor"]}>
  Add full-text search to the widgets list in this project.
</Prompt>
```

Text with tags or braces goes in a `text` fence inside the prompt. The page's Markdown version shows each prompt as a `text` block.

## Colors

A palette shows named colors as swatches; clicking one copies its value. Values are hex, `rgb()` or `hsl()` with numbers, or a CSS color name. Give a swatch its own dark value with `value={{ light, dark }}`, and group swatches under a title with `<Color.Row>`. `variant="table"` lays each row out beside its title.

**Brand**

| Name | Value |
| --- | --- |
| acme-500 | `#3B82F6` |
| acme-700 | `#1D4ED8` |

**Surfaces**

| Name | Light | Dark |
| --- | --- | --- |
| page | `#FFFFFF` | `#0A0A0A` |

```mdx
<Color variant="table">
  <Color.Row title="Surfaces">
    <Color.Item name="page" value={{ light: "#FFFFFF", dark: "#0A0A0A" }} />
  </Color.Row>
</Color>
```

## Tiles

Tiles are a grid of linked previews: an image, a title and a line of text. `cols` sets two to four across; phones show one. Each tile holds one image, which can have a dark version.

```mdx
<Tiles cols={3}>
  <Tile href="/guides/widgets" title="Widgets" description="Build your first widget">
    <img src="/images/widgets.png" darkSrc="/images/widgets-dark.png" alt="Widgets" />
  </Tile>
</Tiles>
```

Mintlify's `<Columns>` of `<Tile>` elements reads as tiles, light and dark image pairs included.

## Views

Views give one page a version per language or framework. A menu at the top of the article picks the view; only that view shows, and **On this page** lists only its headings. Text outside the views shows in every view.

````mdx
<View title="JavaScript">
  ## Install

  ```sh
  npm install example-sdk
  ```
</View>

<View title="Python">
  ## Install

  ```sh
  pip install example-sdk
  ```
</View>
````

Views sit at the top level of the page, each with its own title. A reader's pick is remembered with tabs of the same titles, and links to `#view-python` open that view. Search covers every view, and the page's Markdown lists each view under its title.

## Updates

An update is one entry of a changelog kept on any page. Its label, description and tags sit beside its content on wide screens and above it on phones. Use as many as you need, newest first.

## March 2026

v2.4 · API · Dashboard

Webhooks are signed, and the dashboard shows each delivery.

```mdx
<Update label="March 2026" description="v2.4" tags={["API", "Dashboard"]}>
  Webhooks are signed, and the dashboard shows each delivery.
</Update>
```

`label` is required, up to 60 characters, such as a date or a version. `description` is up to 160 characters, and `tags` up to six of 24 characters each. Each label is a heading: it gets an anchor such as `#march-2026` and a line in **On this page**. Search and the page's Markdown list each update under its label. An update cannot hold another update.

## Code walkthroughs

A walkthrough explains one code block step by step. On wide screens the steps sit beside the code, and the step being read marks its lines. Phones show each step with just its lines.

**Import the client** (line 1)

Bring in `Acme` from example-sdk.

**Create it** (lines 3-5)

Pass your API key. Keep it on the server.

**Send an event** (line 7)

Events arrive in the dashboard within a few seconds.

```ts title="send.ts" lineNumbers
import { Acme } from "example-sdk";

const acme = new Acme({
  apiKey: process.env.ACME_KEY,
});

await acme.events.send({ name: "signup" });
```

````mdx
<Walkthrough>
  <WalkthroughStep lines="3-5" title="Create it">
    Pass your API key.
  </WalkthroughStep>

  ```ts title="send.ts" lineNumbers
  ...
  ```
</Walkthrough>
````

A walkthrough holds one code block and up to 50 steps. `lines` is one line (`4`) or a range (`3-8`) within the code. Line numbers, titles, highlights and diff marks all work as in any code block.

## Repository cards

A repository card links a public GitHub repository with its description, stars and forks.

[acme/widgets](https://github.com/acme/widgets)

```mdx
<GitHub repo="acme/widgets" />

<GitHub repo="acme/gadgets" variant="flat" />
```

`repo` is `owner/name` or the repository's GitHub URL. `variant="flat"` drops the card's background. The details are read from GitHub when the site builds, for up to 10 repositories per build; a private repository, or one past that limit, shows its name and link only.

## Terminal illustrations

A code block in the `terminal` language shows what a command looks like when it runs. `$` starts a command, `?` a question, `( )` and `(x)` a single choice, `[ ]` and `[x]` a choice of several, and `>` a typed answer. A blank line starts the next step; any other line is output. The copy button copies the commands only.

```text title="Create a project"
$ npx create-example-app
? Which template?
(x) Starter
( ) Blank

? Which features?
[x] Search
[ ] Analytics
? Project name
> acme-docs

Created acme-docs
```

````mdx
```terminal title="Create a project"
$ npx create-example-app
? Which template?
(x) Starter
( ) Blank
```
````

## Accordions

<Accordions>
  <Accordion title="Can a page use its own components?">
    No. Pages build to static HTML from the blocks on this page, so a reader's browser never runs code from a page.
  </Accordion>
  <Accordion title="Can I paste Markdown from another tool?">
    Yes. Pasted Markdown becomes blocks, and Mintlify, Docusaurus, GitBook and Fumadocs syntax is read as the matching block.
  </Accordion>
  <Accordion title="How do I link to one answer?" id="link-to-an-answer">
    Give the accordion an `id`. A link to [`#link-to-an-answer`](#link-to-an-answer) opens it and scrolls to it.
  </Accordion>
</Accordions>

```mdx
<Accordion title="How do I link to one answer?" id="link-to-an-answer">
  ...
</Accordion>
```

## Columns

<Columns>
  <Column>
    **Hosted pages** live in Rimfe and are edited in the editor.
  </Column>
  <Column>
    **Repository docs** stay in your repository and are reviewed on pull requests.
  </Column>
</Columns>

## Text

Inline `code`, **bold**, *italic*, ~~struck~~ text, a [link](https://docs.rimfe.com/platform) and keys such as <kbd>Ctrl</kbd> <kbd>K</kbd>.

- A list item
- Another item
  - A nested item

1. First
2. Second

- [x] A finished task
- [ ] An open task

> A quote sets apart someone else's words.

### Heading ids

A heading takes its anchor from its text. `{#id}` after the text sets one that stays put when the text changes.

```mdx
## Install the SDK {#install-sdk}
```

### Badges

A small label in a line: <Badge>Beta</Badge> <Badge tone="success">Stable</Badge> <Badge tone="warning" outline>Changed</Badge> <Badge tone="danger" shape="pill">Removed</Badge>. Tones are `neutral`, `info`, `success`, `warning`, `danger` and `accent`; `outline`, `size="sm"` or `"lg"` and `shape="pill"` change the look. Mintlify's `color` and `stroke` work too.

```mdx
<Badge tone="success">Stable</Badge>
```

### Tooltips

A term with a short explanation: every request carries an <Tooltip tip="A secret key from your dashboard, sent in the Authorization header." headline="API key" cta="Create a key" href="https://docs.rimfe.com/configuration">API key</Tooltip>. It shows on hover and on focus, a tap toggles it on a phone, and Escape hides it.

```mdx
<Tooltip tip="A secret key from your dashboard." headline="API key" cta="Create a key" href="/configuration">API key</Tooltip>
```

## Icons

Icons come from three free sets: [Lucide](https://lucide.dev/icons), [Tabler](https://tabler.io/icons) and [Font Awesome Free](https://fontawesome.com/search?ic=free). Each icon is drawn into the page when the site builds, so readers' browsers never fetch one.

A plain name comes from the site's icon set, Lucide unless you [choose another](https://docs.rimfe.com/platform/customize#brand). A prefix picks a set:

| Name | Set |
| --- | --- |
| `rocket` | The site's set |
| `lucide:rocket` | Lucide |
| `tabler:rocket` | Tabler |
| `fa:rocket` | Font Awesome solid |
| `fa-regular:bell` | Font Awesome regular |
| `fa-brands:github` | Font Awesome brands |

A plain name follows the site's set, so it draws a different icon, or none, if you change the set. Icons you pick in the editor or settings, and icons on generated pages, are written with their prefix and stay the same.

Lucide names also work in PascalCase (`BookOpen`), and Font Awesome names with or without `fa-`. Underscores and spaces read as hyphens, so `book_open` and `book open` draw `book-open`. A name no set has draws nothing, and the build warns once per page with the line.

An icon inside a line of text: <Icon icon="zap" /> fast, <Icon icon="fa-brands:github" /> on GitHub, <Icon icon="circle-check" color="#16a34a" size={18} label="Done" /> done.

```mdx
<Icon icon="circle-check" color="#16a34a" size={18} label="Done" />
```

`size` is in pixels, from 8 to 96; without it the icon matches the text. `color` is a CSS colour, the same in light and dark mode; leave it out and the icon follows the text colour in both. `label` is read by screen readers; without it the icon is decorative. `<Icon name="rocket" />` works too.

These blocks take an `icon`:

| Block | Where it shows |
| --- | --- |
| Card | Above the title, or beside the text with `horizontal` |
| Step | In the marker, in place of the number |
| Callout | In place of the tone's icon |
| Tab, View | Before the tab's or view's name |
| Accordion, Tile, Badge, Prompt | Before the title or text |

<Steps>
  <Step title="Connect the repository" icon="git-branch">
    Rimfe reads the repository's docs folder.
  </Step>
</Steps>

<Callout tone="tip" icon="sparkles">
  A callout with its own icon.
</Callout>

```mdx
<Step title="Connect the repository" icon="git-branch">
<Callout tone="tip" icon="sparkles">
```

A page's `icon` in its front matter shows before its entry in the sidebar, not beside its title. Folders, headings, links, sections and header and footer links take icons in their settings.

Font Awesome Free icons are licensed under CC BY 4.0. Each one carries its licence note in the page, so no credit is needed elsewhere.
