diff --git a/fern/products/docs/pages/component-library/default-components/code-blocks.mdx b/fern/products/docs/pages/component-library/default-components/code-blocks.mdx index 6235fdcbb..91a3b3875 100644 --- a/fern/products/docs/pages/component-library/default-components/code-blocks.mdx +++ b/fern/products/docs/pages/component-library/default-components/code-blocks.mdx @@ -121,8 +121,10 @@ a `maxLines` attribute after the language identifier. The `maxLines` attribute should be a number representing the maximum number of lines to display. By default, the code block will display up to 20 lines. +When you use `maxLines`, an expand button automatically appears on hover in the top-right corner, allowing users to view the full code content in an expanded overlay that displays over the page. + - + ```python maxLines=10 def is_prime(num): """Check if a number is prime.""" @@ -182,6 +184,15 @@ number of lines to display. By default, the code block will display up to 20 lin +To hide the expand button or add custom styling, target the `.fern-expand-button` selector: + +```css +/* Hide the expand button */ +.fern-expand-button { + display: none; +} +``` + ## Wrap overflow By default, long lines that exceed the width of the code block become scrollable: