Skip to main content

The <GlossaryTerm> component

While the remark plugin handles most cases automatically, the GlossaryTerm theme component lets you opt in or override behavior in MDXMDXA Markdown-based format that lets you write JSX inside your markdown, used by Docusaurus v3 for docs and pages. files directly.

Import

import GlossaryTerm from '@theme/GlossaryTerm';

You only need this when you're using the component explicitly — the remarkremarkA markdown processor. Remark plugins transform the markdown AST before it becomes HTML/JSX. plugin injects this import automatically for auto-linked terms.

Usage

Self-closing (term is both the lookup and the display text)

This website uses an <GlossaryTerm term="API" /> to fetch data.

With children (custom display text)

Our <GlossaryTerm term="API">RESTful API</GlossaryTerm> is available.

With an explicit definition (override the JSON)

We use <GlossaryTerm term="REST" definition="Representational State Transfer" /> for our services.

Props

PropRequiredDescription
termyesLookup key matching an entry in glossary.json.
definitionnoOverride the definition from the glossary file.
abbreviationnoOverride the long-form expansion shown in the tooltip.
idnoOverride the glossary entry anchor. Defaults to the configured ID or one derived from term.
routePathnoOverride the glossary page route. Defaults to the configured route or /glossary.
documentationPathnoLink to an internal documentation page instead of the glossary entry.
childrennoCustom display text. Defaults to term.

When to use it manually

  • The auto-linker won't touch terms inside code blocks, existing links, or existing MDXMDXA Markdown-based format that lets you write JSX inside your markdown, used by Docusaurus v3 for docs and pages. components — use the component manually if you want those matched
  • When you need a one-off override of the term text or definition (e.g. localized phrasing) without editing glossary.json