Line numbers
Gutters and line metadata for code content.
Line numbers
The LineNumberRenderable adds gutters and aligns line metadata with code or text. Enable line numbers on a Code renderable or use it standalone to display diagnostics alongside plain text.
<line_number
content={source()}
lineNumbers
highlightedLines={[3, 7, 11]}
/>Highlight specific lines by passing an array of line indices. You can combine this with diff or diagnostic renderables for rich editors.
Props
| Prop | Type | Notes |
|---|---|---|
content | string | Text/code whose lines are numbered. |
lineNumbers | boolean | Enable the gutter itself. |
highlightedLines | number[] | Line indexes to highlight (breakpoints/errors/active line). |