Codeblock
Used to highlight code syntax.
Default
1function MyComponent(props) {
2 const num = 100;
3
4 // This is the comment
5 return (
6 <div>
7 <h1 className="bold">Hello, {props.name}!</h1>
8 <p>This is an example React component.</p>
9 </div>
10 );
11}
Highlighted lines
1function MyComponent(props) {
2 const num = 100;
3
4 // This is the comment
5 return (
6 <div>
7 <h1 className="bold">Hello, {props.name}!</h1>
8 <p>This is an example React component.</p>
9 </div>
10 );
11}
With filename
hello-world.tsx
1function MyComponent(props) {
2 const num = 100;
3
4 // This is the comment
5 return (
6 <div>
7 <h1 className="bold">Hello, {props.name}!</h1>
8 <p>This is an example React component.</p>
9 </div>
10 );
11}
API Reference
Root
React.ComponentPropsWithRef<div>Header
React.ComponentPropsWithRef<div>Prop | Type | Default |
---|---|---|
filename | string | _ |
icon | ReactNode | _ |
Content
React.ComponentPropsWithRef<div>Prop | Type | Default |
---|---|---|
language | string | typescript |
hightlightLines | number[] | [] |