MDXComponents

API Reference

useMDXComponents

(components: RenounComponentsType) => RenounComponentsType
Parameters

components *

RenounComponentsType

pre

((props: BaseCodeBlockProps & { value: string; }) => React.ReactElement) | undefined

code

((props: Omit<CodeInlineProps, "value"> & { children: string; }) => React.ReactElement) | undefined
Return
RenounComponentsType

MDXComponents

{ pre: ({ allowCopy, allowErrors, showErrors, showLineNumbers, showToolbar, highlightedLines, focusedLines, unfocusedLinesOpacity, filename, value, language, className, style, }: BaseCodeBlockProps & { value: string; }) => React.JSX.Element; code: ({ language, children, paddingX, paddingY, className, style }: Omit<CodeInlineProps, "value"> & { children: string; }) => React.JSX.Element; }

Preconfigured Renoun components for pre and code elements.

Properties

pre *

({ allowCopy, allowErrors, showErrors, showLineNumbers, showToolbar, highlightedLines, focusedLines, unfocusedLinesOpacity, filename, value, language, className, style, }: BaseCodeBlockProps & { value: string; }) => React.JSX.Element

*

BaseCodeBlockProps & { value: string; }

code *

({ language, children, paddingX, paddingY, className, style }: Omit<CodeInlineProps, "value"> & { children: string; }) => React.JSX.Element

*

Omit<CodeInlineProps, "value"> & { children: string; }

style

React.CSSProperties | undefined

Style to apply to the wrapping element.

language

Languages | undefined

Language of the code snippet.

allowCopy

boolean | undefined

Show or hide a persistent button that copies the value to the clipboard.

paddingX

string | undefined

Horizontal padding to apply to the wrapping element.

paddingY

string | undefined

Vertical padding to apply to the wrapping element.

css

CSSObject | undefined

CSS styles to apply to the wrapping element.

className

string | undefined

Class name to apply to the wrapping element.

allowErrors

string | boolean | undefined

Whether or not to allow errors. Accepts a boolean or comma-separated list of allowed error codes.

children *

string