MDXTS is now Omnidoc
DocsBlogChangelog

CodeInline

Server Only

Renders an inline code element with optional syntax highlighting and copy button.

This component is automatically set up to override the code element when using the Next.js plugin.

Examples

In React, <span style={{ color: 'blue' }} /> changes the color of the text to blue.

Basic

npm install mdxts

Allow Copy

API Reference

CodeInline

View Source

value *

string

Code snippet to be highlighted.

language

Languages

Language of the code snippet.

allowCopy

boolean

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

paddingX

string= '0.25em'

Horizontal padding to apply to the wrapping element.

paddingY

string= '0.1em'

Vertical padding to apply to the wrapping element.

css

CSSObject

CSS styles to apply to the wrapping element.

className

string

Class name to apply to the wrapping element.

style

React.CSSProperties

Style to apply to the wrapping element.