Toolbar

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

API Reference

ToolbarProps

ToolbarProps
Properties

allowCopy

boolean | string

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

css

CSSObject

CSS object to apply to the toolbar.

className

string

Class name to apply to the toolbar.

style

React.CSSProperties

Style to apply to the toolbar.

children

React.ReactNode

The children of the toolbar rendered at the start.

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>