Skip to Content
🎉 Nextra 4.0 is released. dimaMachina is looking for a new job or consulting .
APINextraConfig

NextraConfig Type

Exported from nextra.

Fields

NameTypeDefault
defaultShowCopyCodeboolean

Enable the copy button for all code blocks by default, without needing to set copy=true attribute in the code block metadata.

Tip

You could still disable the button for specific blocks using copy=false attribute.

staticImageboolean

Option to automatically optimizing your static image imports with the Markdown syntax.

Tip

Example: ![Hello](/demo.png).

true
readingTimeboolean

Adds estimated reading time of .md and .mdx files using readingTime  package.

Tip

The reading time is added to the front matter under the readingTime key.

latexboolean | { renderer: "mathjax"; options?: { src?: string; config?: MathJaxConfig; }; } | { renderer: "katex"; options: Options; }

Enable LaTeX either with KaTeX  to pre-render LaTeX expressions directly in MDX or MathJax  to dynamically render math in the browser.

codeHighlightboolean

Enable or disable syntax highlighting.

true
mdxOptionsMdxOptions

Options specific to MDX compiling.

{ "format": "detect", "rehypePrettyCodeOptions": {} }
whiteListTagsStylingstring[]

Allows you to whitelist HTML elements to be replaced with components defined in the mdx-components.js file.

Tip

By default, Nextra only replaces <details> and <summary> elements.

contentDirBasePathstring

Option to serve your .md and .mdx files from the content directory at a custom path instead of the root (/).

"/"