Code Editor

An inline code editor component.

Usage

Size

Disabled state

Copy to clipboard

Props

PropTypeDefaultDescription
valuestring-The code value to display and edit.
onValueChange(value: string) => void-Callback when the code value changes.
languageCodeMirrorLanguage'unknown'Programming language for syntax highlighting.
size'sm' | 'md' | 'lg''md'Size of the code editor.
disabledboolean-Whether the editor is read-only.
copyToClipboardboolean-Whether to show the copy button.
extensionsExtension | Extension[]-Additional CodeMirror extensions.
backgroundColorstring'var(--lb-product-color-background-surface-base-bold)'Background color of the editor.
classNamestring-Additional CSS classes to apply.