Components Overview

Last updated: 03/04/2026Edit this page

Trellis Docs includes several reusable React components you can import and use in your MDX (Markdown with JSX, a format that lets you use React components inside Markdown files) files.

Included components

ComponentLocationDescription
DocCardListcomponents/custom/doc-card-list.tsxRenders a grid of cards linking to other doc pages, from sidebar or explicit items
DocCardcomponents/custom/doc-card.tsxSingle card linking to a doc page
Glossarycomponents/custom/glossary.tsxRenders a searchable, alphabetically sorted glossary from a JSON data file
FaqTableOfContentscomponents/custom/faq-table-of-contents.tsxRenders a searchable FAQ question list from the FAQ index
Feedbackcomponents/custom/feedback.tsxEmbeddable feedback widget for collecting page-level feedback
Tooltipcomponents/docs/tooltip.tsxInline tooltip that reveals a definition or description on hover
FlippingCardcomponents/custom/flipping-card.tsxInteractive flip cards with quiz/option selection support
Searchcomponents/docs/search/search-dialog.tsxSearch UI with dialog, powered by Fuse.js (Cmd+K)

Using components in MDX

Import any component at the top of your MDX file:

---
title: My Page
---

import { Glossary } from '@/components/custom/glossary';

## Glossary

<Glossary />

The @/ alias resolves to your project root directory.

The search component renders a search icon that opens a dialog with instant search results. You typically don't need to import this directly — it's accessible via Cmd+K (Mac) or Ctrl+K (Windows/Linux).

Tooltip

Adds a hover tooltip to any inline text. Useful for defining acronyms, technical terms, or jargon without interrupting the reading flow. The trigger text is shown with a dashed underline; hovering reveals the tooltip below.

The team agreed on new <Tooltip content="A target or goal for the performance or quality of a service.">SLOs</Tooltip> for the quarter.

Result: The team agreed on new SLOsA target or goal for the performance or quality of a service. for the quarter.

Props

PropTypeRequiredDescription
childrenReactNodeYesThe inline trigger text (visible on the page)
contentstringYesThe tooltip text shown on hover

Tips

  • Keep tooltip content short — one or two sentences. For longer definitions, use the Glossary component instead.
  • Tooltips are CSS-only (no JavaScript) and work in static export.
  • The tooltip automatically adapts to light and dark mode via design tokens.

FlippingCard

Interactive quiz cards that flip to reveal multiple-choice questions with instant feedback. The component is globally registered — no import needed.

<FlippingCard data={[
  {
    byline: "TOPIC",
    title: "Card Title",
    description: "Brief description.",
    frontContent: ["Additional detail."],
    checkYourKnowledge: {
      question: "Your question here?",
      options: ["Option A", "Option B"],
      correctAnswer: 0,
      explanations: [
        { text: "A is correct.", isCorrect: true },
        { text: "B is not the best choice.", isCorrect: false }
      ]
    }
  }
]} />

See the FlippingCard documentation for the full props reference and multi-card examples.


Was this page helpful?