Typemark Documentation

Accordions

Tuck optional detail behind a title readers can click to expand. Stack several in a group for FAQs.

Uuendatud 19. nov 20262 min lugemist

An accordion shows a title and hides its content until the reader clicks it. Use it for detail most readers can skip, like FAQs and troubleshooting.

Which file types can a page use?

Pages are .mdx or .md files. Both take frontmatter for the title and description.

<Accordion title="Which file types can a page use?">
  Pages are `.mdx` or `.md` files. Both take frontmatter for the title and description.
</Accordion>

Description, icon, and open by default

Add a description for a line of smaller text under the title, and an icon to show a Heroicons icon before it. Set defaultOpen to start the accordion expanded.

TroubleshootingWhat to check when a request fails

Check the status code first. A 401 means the API key is missing or wrong.

<Accordion title="Troubleshooting" description="What to check when a request fails" icon="wrench-screwdriver" defaultOpen>
  Check the status code first. A `401` means the API key is missing or wrong.
</Accordion>

Accordion groups

Wrap accordions in <AccordionGroup> to put them in one frame with a divider between each. It's the tidiest way to lay out an FAQ.

Can I use my own domain?

Yes. Add it in your project settings, then create a CNAME record pointing to cname.typemark.dev.

Can I export my content?

Your pages live in a Git repository. Connect it to GitHub to keep a copy in your own account.

Does the visual editor change my MDX?

Not behind your back. Components it has no block for show as read-only source and save back exactly as written.

<AccordionGroup>
  <Accordion title="Can I use my own domain?">
    Yes. Add it in your project settings, then create a CNAME record pointing to `cname.typemark.dev`.
  </Accordion>
  <Accordion title="Can I export my content?">
    Your pages live in a Git repository. Connect it to GitHub to keep a copy in your own account.
  </Accordion>
  <Accordion title="Does the visual editor change my MDX?">
    Not behind your back. Components it has no block for show as read-only source and save back exactly as written.
  </Accordion>
</AccordionGroup>

Rich content

The body can hold anything a page can, including code blocks and callouts.

How do I authenticate requests?

Send your API key in the Authorization header:

const response = await fetch("https://api.acme.com/data", {
  headers: { Authorization: "Bearer sk_live_abc123" },
});

Props

Accordion

PropTypeDefaultDescription
titlestringnoneText in the clickable header.
descriptionstringnoneSmaller line of text under the title.
iconstringnoneHeroicons name shown before the title.
defaultOpenbooleanfalseStarts the accordion expanded.

AccordionGroup

<AccordionGroup> takes no props. Put <Accordion> blocks inside it.

In the visual editor

Type / and pick Accordion. Edit the title in the header and type the content below it. Props the editor doesn't show, like description and icon, are kept as you wrote them when you save.