Line Numbers
Show line numbers
Install
$ pnpm dlx shadcn@latest add https://docskit.codehike.org/r/line-numbers
Add the line-numbers
handler:
@/components/code.handlers.tsx
+import { lineNumbers } from "./line-numbers"export function getHandlers(options: CodeOptions,) {return [line,+options.lineNumbers && lineNumbers,]}
ExampleTry it in the Playground
content.mdx
```js -nfunction lorem(ipsum) {return ipsum}```
preview
1function lorem(ipsum) {2return ipsum3}