Editor
A retained native code editor with syntax coloring, line numbers, indentation, and both-axis scrolling.
No language grammars are included by default. Register a linked grammar in Rust, or load one portable pack of selected Tree-sitter Wasm grammars and queries using loadLanguagePack (TypeScript) / LoadLanguagePack (Go).
Unstyled by default: text and line-number colors inherit, and the component adds no background, border, rounding, padding, or syntax/diff palette. Supply application styles and explicit colors to opt into an appearance.
#Import
bun add @quickgui/extension-editorimport { createSignal } from "solid-js";
import { Editor, loadLanguagePack } from "@quickgui/extension-editor";// quickgui.config.ts
extensions: ["@quickgui/extension-editor"]#Usage
const [source, setSource] = createSignal("export function answer() { return 42; }\n");
<Editor
value={source()}
language="typescript"
lineNumbers
tabSize={2}
onInput={(event) => setSource(event.value ?? "")}
style={{ width: "100%", height: 360 }}
/>;#Syntax highlighting
language selects a registered Tree-sitter grammar and highlight query. Query captures map through syntaxTheme to eight foreground-only paint classes, so color never changes text metrics. Source or language changes reparse the bounded document; palette changes only remap retained captures, and scrolling does no syntax work. Parsing is limited to 2 MiB, individual lines over 32 KiB stay plain, and the capture count is capped. This does not require a language server.
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
Editor
View sourceEditor(props: EditorProps): NativeNodeaccessibilityLabelstring—
Declares accessibilityLabel (optional). Reactive JSX expressions update this property in place.
stringView sourcestyleStyleProp—
Layout, typography, paint, and interaction-state styles. Arrays merge left to right.
StylePropView sourcedisabledboolean—
Declares disabled (optional). Reactive JSX expressions update this property in place.
booleanView sourceinvalidboolean—
Expose web-style invalid state; the `style.invalid` variant paints while it is set.
booleanView sourceselectedboolean—
Expose web-style selected state; the `style.selected` variant paints while it is set.
booleanView sourcegroupboolean | string—
Makes this element the group its descendants' `groupHover` and `groupActive` styles follow, like Tailwind's `group`: `true` opens an unnamed group, and a string names it so a descendant can follow it past a nearer group with `groupHover: { group: "name" }`.
boolean | stringView sourcerolestring—
tabIndexnumber—
Declares tabIndex (optional). Reactive JSX expressions update this property in place.
numberView sourcefocusOnPointerboolean—
overlayboolean—
focusTrapboolean—
restorePreviousFocusboolean—
autoFocusboolean—
aria-modalboolean—
ariaModalboolean—
Declares ariaModal (optional). Reactive JSX expressions update this property in place.
booleanView sourcedismissOnEscapeboolean—
Declares dismissOnEscape (optional). Reactive JSX expressions update this property in place.
booleanView sourcedismissOnPointerOutsideboolean—
Declares dismissOnPointerOutside (optional). Reactive JSX expressions update this property in place.
booleanView sourcetooltipstring—
tooltipPlacementPopoverPlacement—
Declares tooltipPlacement (optional). Reactive JSX expressions update this property in place.
PopoverPlacementView sourcetooltipDelaynumber—
tooltipGapnumber—
Declares tooltipGap (optional). Reactive JSX expressions update this property in place.
numberView sourcetooltipViewportMarginnumber—
Declares tooltipViewportMargin (optional). Reactive JSX expressions update this property in place.
numberView sourcehitSlopnumber | string—
Declares hitSlop (optional). Reactive JSX expressions update this property in place.
number | stringView sourcehitSlopTopnumber | string—
Declares hitSlopTop (optional). Reactive JSX expressions update this property in place.
number | stringView sourcehitSlopRightnumber | string—
Declares hitSlopRight (optional). Reactive JSX expressions update this property in place.
number | stringView sourcehitSlopBottomnumber | string—
Declares hitSlopBottom (optional). Reactive JSX expressions update this property in place.
number | stringView sourcehitSlopLeftnumber | string—
Declares hitSlopLeft (optional). Reactive JSX expressions update this property in place.
number | stringView sourcearia-labelstring—
Declares aria-label (optional). Reactive JSX expressions update this property in place.
stringView sourceariaLabelstring—
Declares ariaLabel (optional). Reactive JSX expressions update this property in place.
stringView sourceref((node: NativeNode) => void) | NativeNode—
Declares ref (optional). Reactive JSX expressions update this property in place.
((node: NativeNode) => void) | NativeNodeView sourceonClickEventHandler—
Declares onClick (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonMouseEnterEventHandler—
Declares onMouseEnter (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonMouseLeaveEventHandler—
Declares onMouseLeave (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonPointerEnterEventHandler—
Declares onPointerEnter (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonPointerLeaveEventHandler—
Declares onPointerLeave (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonPointerEventHandler—
Captured pointer stream from press through release/cancel, including outside the element.
EventHandlerView sourceonInputEventHandler—
Declares onInput (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonChangeEventHandler—
Declares onChange (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonSubmitEventHandler—
Declares onSubmit (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonDismissEventHandler—
Declares onDismiss (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonKeyDownEventHandler—
Focused key press. Declare a `tabIndex` to make an ordinary container focusable.
EventHandlerView sourceonKeyUpEventHandler—
Declares onKeyUp (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonMouseDownEventHandler—
Declares onMouseDown (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonMouseUpEventHandler—
Declares onMouseUp (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonMouseMoveEventHandler—
Declares onMouseMove (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonDoubleClickEventHandler—
onWheelEventHandler—
Declares onWheel (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonContextMenuEventHandler—
onPinchEventHandler—
Declares onPinch (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonRotateEventHandler—
Declares onRotate (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonSmartMagnifyEventHandler—
Declares onSmartMagnify (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonPressureEventHandler—
Declares onPressure (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonFocusEventHandler—
Declares onFocus (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonBlurEventHandler—
Declares onBlur (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourcekeymapKeymap—
onActionEventHandler—
draggableboolean | DragSource—
onDragStartEventHandler—
Declares onDragStart (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonDragEndEventHandler—
Declares onDragEnd (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourcedropKindsDropKind | readonly DropKind[]—
Payload kinds this element accepts, declared ahead of the native drag.
DropKind | readonly DropKind[]View sourceonDropEventHandler—
Declares onDrop (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourceonFilesDroppedEventHandler—
Declares onFilesDropped (optional). Reactive JSX expressions update this property in place.
EventHandlerView sourcevaluestring—
languageEditorLanguage—
Declares language (optional). Reactive JSX expressions update this property in place.
EditorLanguageView sourcelineNumbersboolean—
Declares lineNumbers (optional). Reactive JSX expressions update this property in place.
booleanView sourcetabSizenumber—
Declares tabSize (optional). Reactive JSX expressions update this property in place.
numberView sourceinsertSpacesboolean—
Declares insertSpaces (optional). Reactive JSX expressions update this property in place.
booleanView sourceautoIndentboolean—
Declares autoIndent (optional). Reactive JSX expressions update this property in place.
booleanView sourcereadOnlyboolean—
Declares readOnly (optional). Reactive JSX expressions update this property in place.
booleanView sourcecontentPaddingContentPadding—
Declares contentPadding (optional). Reactive JSX expressions update this property in place.
ContentPaddingView sourcegutterPaddingGutterPadding—
Declares gutterPadding (optional). Reactive JSX expressions update this property in place.
GutterPaddingView sourcegutterBackgroundColorValue—
Declares gutterBackground (optional). Reactive JSX expressions update this property in place.
ColorValueView sourcegutterColorColorValue—
Declares gutterColor (optional). Reactive JSX expressions update this property in place.
ColorValueView sourceactiveLineBackgroundColorValue—
Declares activeLineBackground (optional). Reactive JSX expressions update this property in place.
ColorValueView sourceactiveLineNumberColorColorValue—
Declares activeLineNumberColor (optional). Reactive JSX expressions update this property in place.
ColorValueView sourcesyntaxThemeSyntaxTheme—
Declares syntaxTheme (optional). Reactive JSX expressions update this property in place.
SyntaxThemeView source