Tokens
Renders syntax highlighted tokens for the CodeBlock
component.
API Reference
Tokens
View Sourcetokens
Awaited<ReturnType<GetTokens>>
Syntax highlighted tokens from getTokens
to render.
css
{ token?: CSSObject popover?: CSSObject }
CSS style object to apply to the tokens and popover elements.
token
CSSObject
popover
CSSObject
className
{ token?: string popover?: string }
= {}
Class names to apply to the tokens and popover elements.
token
string
popover
string
style
{ token?: React.CSSProperties popover?: React.CSSProperties }
= {}
Styles to apply to the tokens and popover elements.
token
React.CSSProperties
popover
React.CSSProperties
renderLine
(line: { children: React.ReactNode index: number isLast: boolean }) => React.ReactNode
Custom render function for each line of tokens.