Skip to content

How to set codeblock max content height and not scrolling? #1018

Answered by fuma-nama
himself65 asked this question in Q&A
Discussion options

You must be logged in to vote

We have a custom meta field allowed for code blocks

```js custom="noscroll"
hello world
```

You can receive the custom prop from MDX components pre in page.tsx and turn it into a JSX className/style prop that specifies the CSS max height, it should be passed to Pre (see https://fumadocs.vercel.app/docs/ui/mdx/codeblock#usage).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by himself65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants