logo
On this page

Components

This section introduce how to use mdx components to enrich your docs content. We support most markdown applications.

Titles and headings

Best used for page headers.

Untitled
# Your Page Header
1
Copied!
How to WriteRendered Output
# Heading level 1

Heading level 1

## Heading level 2

Heading level 2

### Heading level 3

Heading level 3

#### Heading level 4

Heading level 4

##### Heading level 5
Heading level 5
###### Heading level 6
Heading level 6

Text formatting

We support most markdown formatting.

StyleHow to writeRendered Output
Bold**Bold text**Bold text
Italic_Italic text_Italic text
Strike~~Strikethrough~~Strikethrough

You can combine these to emphasize text with bold and italics at the same time. For example, you can write **_Bold with Italic_** or __*Bold with Italic*__ to get Bold with Italic text.

If you want to write superscript or subscript text, you need to use HTML.

StyleHow to writeRendered Output
Superscript<sup>superscript</sup>superscript
Subscript<sub>subscript</sub>subscript

lists

You can order your content into ordered number lists or unrdered bulleted lists.

Number list

Best used for Number list.

Untitled
1. First list
2. Second list
3. Third list 
1
Copied!

Bulleted list

You can add-, *, or+ in front of each line items to create bulleted lists.

Best used for bulleted list.

Untitled
- First list
- Second list
- Third list 
1
Copied!
  • First list
  • Second list
  • Third list

Inorder to create a link, you can enclose the link text in brackets (e.g., [Docuo]) and then follow it immediately with the URL in parentheses (e.g., (https://www.spreading.ai/)).

Untitled
I love using [Docuo](https://www.spreading.ai/) to generate online docs.
1
Copied!

The rendered output looks like this: I love using Docuo to generate online docs.

Quotes

You can add a > in front of a paragraph to create a quote.

Untitled
> I love using Docuo to generate online docs.
1
Copied!

The rendered output looks like this:

I love using Docuo to generate online docs.

Divider

Best used for divider.

Untitled
---
1
Copied!

Tables

We support the offical markdown table syntax.

To add a table, use three or more hyphens --- to create each column’s header, and use pipes | to separate each column. You should also add a pipe on either end of the row.

Untitled
| Title | Description  |
| ----- | ------------ |
| Item1 | Destription1 |
| Item2 | Destription2 |
1
Copied!

The rendered output looks like this:

TitleDescription
Item1Destription1
Item2Destription2

Callouts

There are four types of callouts prepared for you to match different needs, including <Check>, <Tip>, <Note>, <Warning>, and <Error>.

  • Check
Untitled
<Check title="Check">This adds a check list to confirm</Check>
1
Copied!

The rendered output looks like this:

Check
This adds a check list to confirm

  • Tip
Untitled
<Tip title="Tip">This suggests a helpful tip</Tip>
1
Copied!

The rendered output looks like this:

Tip
This suggests a helpful tip
  • Note
Untitled
<Note title="Note">This adds a note in the content</Note>
1
Copied!

The rendered output looks like this:

Note
This adds a note in the content
  • Warning
Untitled
<Warning title="Warning">This raises a warning to watch out for</Warning>
1
Copied!

The rendered output looks like this:

Warning
This raises a warning to watch out for
  • Error
Untitled
<Error title="ERROR">This raises a error to watch out for</Error>
1
Copied!

The rendered output looks like this:

ERROR
This raises a error to watch out for

Cards

Single Card

Untitled
<Card title="Card title" icon="./lightbulb-solid.svg" href="/overview/introduction">
  This is a Card example with `href` prop. Clicking will navigate to the `href` refers to.
</Card>
1
Copied!

Props

PropProp typeDescription
titlestringThe title of the card.
iconstring or svgA local path of icon or SVG code in icon={}.
hrefstringThe url that clicking on the card would navigate the user to.

Card Groups

Use CardGroup to show cards side by side in a grid format.

Untitled
<CardGroup cols={2}>
  <Card title="First Card">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit
  </Card>
  <Card title="Second Card">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit
  </Card>
  <Card title="Third Card">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit
  </Card>
  <Card title="Fourth Card">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit
  </Card>
</CardGroup>
1
Copied!

The CardGroup component lets you group multiple Card components. It's most often used to put multiple cards in the same column.

First Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Second Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Third Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Fourth Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Tabs

Toggle content using the Tabs component, supporting embedding other components. You can add any number of tabs.

Untitled
<Tabs>
  <Tab title="First Tab">
    ☝️ Welcome to the content that you can only see inside the first Tab.
  </Tab>
  <Tab title="Second Tab">
    ✌️ Here's the content that's only inside the second Tab.
  </Tab>
  <Tab title="Third Tab">
    💪 Here's the content that's only inside the third Tab.
  </Tab>
</Tabs>
1
Copied!

The rendered outout looks like this:

Tab Props

PropProp typeDescription
titlestringThe title of the tab. Short titles are easier to navigate.

Accordion

A dropdown component for toggling content.

Untitled
<Accordion title="I am an Accordion." defaultOpen="true">
  You can put any content in here.
</Accordion>
1
Copied!

The rendered outout looks like this:

I am an Accordion.

You can put any content in here.

Accordion Props

PropProp typeDescription
titlestringTitle in the Accordion preview.
defaultOpenbooleanWhether the Accordion is open by default.

Button

A clickable button that opens a link when clicked.

  • External link
Untitled
<Button href="https://docuo.spreading.io/editing-docs/components" primary-color="Green" target="_blank">Click me</Button>
1
Copied!
  • Internal link
Untitled
<Button href="./Components.mdx" primary-color="Green" target="_blank">Click me</Button>
1
Copied!

The rendered outout looks like this:

Click me

Button Props

PropProp typeDescription
hrefstringThe url that clicking on the button would navigate the user to.
primary-colorPrimaryColorButton theme color name, refer to the PrimaryColor enumeration below.
targetstringHow to open the link, the default _blank, reference https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/a#target.

Primary Color

NameTheme color
DarkGray{ "background": "#171717", "color": "#FFFFFF" }
NavyBlue{ "background": "#587FFF", "color": "#FFFFFF" }
Orange{ "background": "#FF9D00", "color": "#FFFFFF" }
Tangerine{ "background": "#FF4400", "color": "#FFFFFF" }
Red{ "background": "#FF0014", "color": "#FFFFFF" }
Magenta{ "background": "#FF00FF", "color": "#FFFFFF" }
Purple{ "background": "#8163F6", "color": "#FFFFFF" }
LightBlue{ "background": "#00B5FF", "color": "#FFFFFF" }
Turquoise{ "background": "#00CAE4", "color": "#FFFFFF" }
Green{ "background": "#00BD46", "color": "#FFFFFF" }
Lime{ "background": "#00A900", "color": "#FFFFFF" }
Gray{ "background": "#777381", "color": "#171717" }
White{ "background": "#FFFFFF", "color": "#171717" }

Steps

Sequence content using the Steps component.

Untitled
<Steps>
  <Step title="First Step">
    These are instructions or content that only pertain to the first step.
  </Step>
  <Step title="Second Step">
    These are instructions or content that only pertain to the second step.
  </Step>
  <Step title="Third Step">
    These are instructions or content that only pertain to the third step.
  </Step>
</Steps>
1
Copied!

Steps are the best way to display a series of actions of events to your users. You can add as many steps as desired.

1
First Step

These are instructions or content that only pertain to the first step.

2
Second Step

These are instructions or content that only pertain to the second step.

3
Third Step

These are instructions or content that only pertain to the third step.

Steps Props

PropProp typeDescription
titleSizestringThe size of the step titles. One of p, h2 and h3. Default: p

Individual Step Props

PropProp typeDescription
titlestringThe title is the primary text for the step and shows up next to the indicator.
iconstring or svgA local path of icon or SVG code in icon={}.
stepNumbernumberThe number of the step.
titleSizestringThe size of the step titles. One of p, h2 and h3. This value would override titleSize of Steps.

Code blocks

Inline code blocks

You can enclose the inline code in backticks (e.g., Docuo)

Untitled
Add a `inline code block` in a sentence.
1
Copied!

The rendered output looks like this: Add a inline code block in a sentence.

Single Code blocks

You can use fenced code blocks by enclosing code in three backticks.

Untitled
```
helloWorld();
```
1
Copied!

The rendered output looks like this:

Untitled
helloWorld();
1
Copied!

You can put the name of your programming language after the first three backticks to get syntax highlighting. Or you can indicate the lines to be highlighted in curly brackets.

Untitled
```jsx {1,4-6,11}
import React from 'react';

function MyComponent(props) {
  if (props.isBar) {
    return <div>Bar</div>;
  }

  return <div>Foo</div>;
}

export default MyComponent;
```
1
Copied!
Untitled
import React from 'react';

function MyComponent(props) {
  if (props.isBar) {
    return <div>Bar</div>;
  }

  return <div>Foo</div>;
}

export default MyComponent;
1
Copied!

You can add more text after the programming language to set the name of your code example. The text can be anything as long as its all in one line.

Untitled
```javascript helloWorld.js
console.log("Hello World");
```
1
Copied!
helloWorld.js
console.log("Hello World");
1
Copied!

Code blocks show line numbers by default. If you want to hide line numbers, you can add hideLineNumbers at the end of the first three backticks.

Untitled
```jsx helloWorld.js {1,4-6,11} hideLineNumbers
import React from 'react';

function MyComponent(props) {
  if (props.isBar) {
    return <div>Bar</div>;
  }

  return <div>Foo</div>;
}

export default MyComponent;
```
1
Copied!
helloWorld.js
import React from 'react';

function MyComponent(props) {
  if (props.isBar) {
    return <div>Bar</div>;
  }

  return <div>Foo</div>;
}

export default MyComponent;
Copied!

Code groups

Use <CodeGroup> to aggregate multiple code blocks into one code group.

Untitled
<CodeGroup>
```javascript helloWorld.js
console.log("Hello World");
```

```python hello_world.py
print('Hello World!')
```

```java HelloWorld.java
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
```
</CodeGroup>
1
Copied!

The rendered output looks like this:

helloWorld.js
hello_world.py
HelloWorld.java
console.log("Hello World");
1
Copied!
print('Hello World!')
1
Copied!
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
1
Copied!

Images

We support displaying images through repository path or by adding image path

Untitled
<Frame width="300" height="auto" caption="image description text">
  <img src="/path/image.jpg" />
</Frame>
1
Copied!
IndexIndex typeDescription
widthvalue greater than 0, or "auto"The width of the image. If "aoto" is set, the image width will adapt to the page.
heightvalue greater than 0, or "auto"The width of the image. If "aoto" is set, the image height will adapt to the page.
captionstringText description at the bottom of the image.

Videos

We support displaying Youtube,vimeo, and Loom online videos.

Untitled
<Video src="https://youtube.com/xxxxxx"/>
1
Copied!