Toolbar

A toolbar for the CodeBlock component that displays the file path, a source link, and copy button.

API Reference

Toolbar

({ allowCopy, css, className, style, children, }: ToolbarProps) => Promise<React.JSX.Element>

A toolbar for the CodeBlock component that displays the file path, a source link, and copy button.

Parameters
ToolbarProps
Returns
Promise<Element>

ToolbarProps

ToolbarProps
Properties

allowCopy

string | boolean | undefined

Whether or not to allow copying the code block value. Accepts a boolean or a string that will be copied.

css

CSSObject | undefined

CSS object to apply to the toolbar.

className

string | undefined

Class name to apply to the toolbar.

style

React.CSSProperties | undefined

Style to apply to the toolbar.

children

React.ReactNode

The children of the toolbar rendered at the start.