Here's all the components you can use in your markdown files while using Hyperdocs:
Callouts
This is an info callout
Here's a tip!
This is a success callout
This is a warning callout
This is a danger callout
<Callout type='info | tip | success | warning | danger'>
This is an **info callout**
</Callout>
Just use the type attribute to set the type of the callout.
Tooltips
Hover me
to show tooltips in docs.
<Tooltip content="Hi there, nice to meet you">Hover me</Tooltip> to show tooltips in docs.
This is how you use tooltips in your docs.
Badges
A badge is a visual indicator for to draw attention of the user. Eg. A new feature, a new update, in beta, etc.
Hyperdocs provides a ready-to-use badge component that you can use in docs and blogs.
Beta
// default color is green
<Badge block color='green | red | blue | yellow'>
Beta
</Badge>
// the block attribute is optional which sets the css display property to block
Switch the dark/light theme to see the 2 different variants of the badges.
All available badges
AlphaBetaGammaDelta
Accordions
Hi there
Hello world 👋
<Accordion title='Hi there'>Hello world 👋</Accordion>
Loom video embed
Loom let's you easily embed videos in webpages.
But the embed can decrease the lighthouse score and affects the speed of the page.
And that's why Hyperdocs provides a component
that helps you embed loom videos without affecting the loading of the page.
Hyperdocs Intro
<Loom url='LOOM-VIDEO-URL' title='TITLE' />
LOOM-VIDEO-URL is the url that you find in the address bar of the browser in Loom's dashboard, not the embedding URL that Loom provides. Hyperdocs auto-generates the embed link from the regular URL(https://loom.com/share/video-id)
Sandpack
Sandpack from CodeSandbox. Hyperdocs just exposes the Sandpack component from it so that you can use everything out of it.
import Rm from 'react-markdown'
import {Tooltip} from 'react-tiny-tooltip'
export default function App() {
return (
<div>
<Rm>Hello *world*. **Wassup**</Rm>
<Tooltip content="Hey there">Hover me 🙌</Tooltip>
</div>
)
}
To enter the code editing mode, press Enter. To exit the edit mode, press Escape
You are editing the code. To exit the edit mode, press Escape
CustomComponent is just a wrapper div with classname not-prose. It's used to prevent the styles from tailwind typography plugin.
Grids
The Grid component is used to display cards in the beginning of your docs that helps the user navigate to the main parts of the documentation.
<Grid
items={[
{
title: 'Introduction',
description: 'Get started with Hyperdocs and build your first docs site',
color: 'blue',
customColor: string,
link: string,
},
]}
/>
<Grid
items={[
{
title: 'Introduction',
description: 'Get started with Hyperdocs and build your first docs site',
color: 'blue',
},
{
title: 'Quickstart',
description: 'Create your first documentation site in less than a minute',
color: 'green',
},
{
title: 'How it works',
description: 'How Hyperdocs works behind the scenes',
color: 'teal',
},
{
title: 'Migration guide',
description:
'Move your docs site to Hyperdocs and simplify your docs setup',
color: 'gray',
},
{
title: 'Migration guide',
description:
'Move your docs site to Hyperdocs and simplify your docs setup',
color: 'orange',
},
{
title: 'Migration guide',
description:
'Move your docs site to Hyperdocs and simplify your docs setup',
color: 'purple',
},
{
title: 'Migration guide',
description:
'Move your docs site to Hyperdocs and simplify your docs setup',
color: 'cyan',
},
{
title: 'Migration guide',
description:
'Move your docs site to Hyperdocs and simplify your docs setup',
color: 'yellow',
},
]}
/>
You can also use markdown in the description field.