DocsKitalpha

Expandable

An expandable code block

Install

$ pnpm dlx shadcn@latest add https://docskit.codehike.org/r/expandable?token=*****
Sign in to unlock your token. View pricing for details.

Add the expandable handler:

@/components/code.handlers.tsx
+
import { expandable } from "./expandable"
export function getHandlers(options: CodeGroup["options"]) {
return [
line,
+
expandable,
]
}

ExampleTry it in the Playground

content.mdx
```js index.js -nc
function lorem(ipsum) {
const a = 1
const b = 2
const c = 3
const d = 4
const e = 5
// !expandable
const f = 6
const g = 7
const h = 8
const i = 9
const j = 10
const k = 11
const l = 12
}
```
preview
index.js
1
function lorem(ipsum) {
2
const a = 1
3
const b = 2
4
const c = 3
5
const d = 4
6
const e = 5