MDX Components
Code blocks without line numbers
Example:
async function main() {const allUsers = await prisma.user.findMany();console.log(allUsers);}
Code:
```js no-linesasync function main() {const allUsers = await prisma.user.findMany()console.log(allUsers)}```
Code blocks with line numbers
Example: Line Numbers
1async function main() {2 added code34 single line highlight56 edited7 code89 highlights10 over multiple11 lines can be done by using12 a hyphen13}
Code:
```js {4,9-12}async function main() {added codedeleted codeeditedcodehighlightsover multiplelines can be done by usinga hyphen}```
CodeSandbox
Prop | Type | Default | Description |
---|---|---|---|
title | string | Dispaly Title for Embedded CodeSandbox | |
id | string | id of unique CodeSandbox of the project | |
view | enum | preview or editor defaults to 50/50 split view | |
showFile | string | Relitive path of file to display onload /<path>/**/<file>.js |
1<CodeSandbox2 title="Great Example of Media"3 id="determined-davinci-6kd2w"4 showFile="/pages/about.js"5/>