Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion content/components/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,36 @@ const hello = "world";
```
````

## Line Highlighting

You can highlight specific lines in your code blocks by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.

```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```

````md
```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````

## Code Groups

Want to display multiple code examples in one code box? Check out the Code Group docs:

<Card title="Code Group" href="/content/components/code-groups" icon="columns-3">
<Card
title="Code Group"
href="/content/components/code-groups"
icon="columns-3"
>
Read the reference for the Code Group component
</Card>