WritedocsWritedocs

Components

Components are tags you write in an .mdx page, like <Callout> or <Card>. All of them are available in every page and snippet, with no import.

<Callout type="tip" title="Before you start">
  You'll need an API key - create one in the dashboard.
</Callout>
Before you start#

You’ll need an API key - create one in the dashboard.

Callouts and text

Layout

Organizing content

Code

Media

Reference

Writing components

  • Props are written like HTML attributes: text in quotes (title="Setup"), anything else in braces (cols={3}, defaultOpen={true}, tags={["Fix"]}). A prop with no value is true: <Accordion defaultOpen>.
  • Content goes between the opening and closing tags, and can be Markdown - lists, code blocks, other components. Leave a blank line after the opening tag when the content starts with a list or a code block.
  • Mistakes - a tag that isn’t closed, or a component that doesn’t exist - are reported by writedocs validate and writedocs dev, with the file and line. An unknown component shows just its content.

Your own classes

Every component accepts className, added to its outer element:

<Card title="Enterprise" className="featured-card" href="/enterprise/">
  SSO, audit logs and a dedicated contact.
</Card>

Style the class in a CSS file, or use utility classes directly: className="mt-8".

Your own components

For something no component covers, write a React component in a snippet, and import it.