code/HighlightedCode
import { … } from 'zidane-ui'ui/src/code/HighlightedCode.tsx
Components#
HighlightedCodeComponent#
Highlighted code with a copy button, plain until it nears the viewport. The highlighter and
theme come from the enclosing CodeHighlightProvider.
function HighlightedCode(props: HighlightedCodeProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | HighlightedCodeProps | The |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| actions? | (buttonClass: string) => ReactNode | Extra controls before Wrap and Copy: |
| className? | string | Extra classes on the root element. |
| code | string | The code to show, without the closing newline. |
| copyLabel? | string | Accessible name of the copy button. Defaults to the frame's. |
| language | string | A language name or alias ( |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
HighlightedCodePropsInterface#
Props of HighlightedCode.
interface HighlightedCodePropsProperties
| Name | Type | Description |
|---|---|---|
| actions? | (buttonClass: string) => ReactNode | Extra controls before Wrap and Copy: |
| className? | string | Extra classes on the root element. |
| code | string | The code to show, without the closing newline. |
| copyLabel? | string | Accessible name of the copy button. Defaults to the frame's. |
| language | string | A language name or alias ( |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |