DocsComponentsUtilitiesGuidesSponsorsLicense
  • Docs

    • Introduction
    • Getting Started
    • Configuration
  • Components

    • CodeBlock
      • CopyButton
      • LineNumbers
      • Tokens
      • Toolbar
    • CodeInline
    • Copyright
    • GitProvider
    • MDX
    • Markdown
    • PackageInstall
    • Reference
    • Refresh
    • Theme
      • ThemeStyles
  • Utilities

    • File System
  • Guides

    • MDX
    • Next.js
    • Waku
    • Zod
    • Valibot
  • © 2025 souporserious

LineNumbers

Renders line numbers for the CodeBlock component.

API Reference

Last updated 03/12/25
Previous
CopyButton
Next
Tokens

On this page

  1. API Reference
  2. LineNumbersProps
  3. LineNumbers
  4. calculateLinesToHighlight

  5. View Source

Properties

PropertyType
highlightRanges?string
css?CSSObject
className?string
style?CSSProperties

Renders line numbers for the CodeBlock component.

Properties

LineNumbersProps

Calculate which lines to highlight based on the range meta string added by the rehype plugin.

Parameters

ParameterTypeDefault Value
rangesranges: string | undefined—

Returns

(index: number) => boolean