EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
CodeEditor·component·@astryxdesign/labExperimental

Code Editor

Editable code component with real-time syntax highlighting using the CSS Custom Highlight API. Supports line numbers, read-only state, placeholder text, and custom tokenizers.

@astryxdesign/lab

Usage

Editable code component with real-time syntax highlighting using the CSS Custom Highlight API. Supports line numbers, read-only state, placeholder text, and custom tokenizers.

Typed props

PropType and behavior
valuestring · required
Controlled string value for the editor.
onChange(value: string) => void · required
Callback fired when the code content changes.
labelstring · required
Accessible label for the editable region (aria-label).
languagestring · default 'plaintext'
Programming language for syntax highlighting.
hasLineNumbersboolean · default false
Display line number gutter on the left.
isReadOnlyboolean · default false
Renders the editor in a read-only state.
placeholderstring
Placeholder text displayed when value is empty.
maxHeightnumber | string
Maximum container height before internal scrolling.
size'sm' | 'md' · default 'md'
Font size variant for the code text.
tokenizer(code: string, language: string) => TokenLine[]
Custom tokenizer function override for language parsing.
xstyleStyleXStyles
StyleX styles for layout customization.