Tokens

API Reference

Tokens

(props: TokensProps) => React.JSX.Element

Renders syntax highlighted tokens for the CodeBlock component.

Parameters
TokensProps
Return
Element

TokensProps

TokensProps

Properties

tokens

Array<Tokens> | undefined

Syntax highlighted tokens from getTokens to render.

css

{ token?: CSSObject; popover?: CSSObject; } | undefined

CSS style object to apply to the tokens and popover elements.

className

{ token?: string; popover?: string; } | undefined

Class names to apply to the tokens and popover elements.

style

{ token?: React.CSSProperties; popover?: React.CSSProperties; } | undefined

Styles to apply to the tokens and popover elements.

renderLine

((line: { children: React.ReactNode; index: number; isLast: boolean; }) => React.ReactNode) | undefined

Custom render function for each line of tokens.