Skip to main content

You can highlight particular lines in MDX codeblocks

1 min read

By using the following syntax, you can highlight specific lines of your codeblock.

Bonus: you can add a filename to the codeblock too.

```jsx {1,5-10} filename="src/details.jsx"

```
import React from 'react';

const Details = (props) => {
  const { title, body } = props;
  return (
    <details>
        <summary>{title}</summary>
        <div>{body}</div>
    </details>
}
© 2021 by Madole.
GitHub Repository
Last build: 1731364498764