TextEditorOptions
import type { TextEditorOptions } from 'pixi-silk/ui/textedit';
Options of a TextEditor: the text style plus how it edits.
Extends#
Omit<SilkTextOptions,"wordWrap"|"wordWrapWidth"|"label">
Properties#
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
aaWidth? | number | Width of the anti-aliasing ramp in device pixels. Larger is softer. Default 1. | - | SilkTextOptions.aaWidth | text/SilkText.ts:94 |
align? | TextAlign | Alignment of the lines. Default left. | - | SilkTextOptions.align | text/SilkText.ts:76 |
anchor? | number | PointData | Point of the text box at the position: 0 is the top left, 1 the bottom right. Default 0. | - | SilkTextOptions.anchor | text/SilkText.ts:102 |
ariaLabel? | string | Name of the field for screen readers. Default the placeholder. | - | - | ui/textedit.ts:96 |
atlas? | SdfAtlas | Atlas to bake glyphs into. Default SdfAtlas.shared. | - | SilkTextOptions.atlas | text/SilkText.ts:104 |
breakWords? | boolean | Breaks words that are wider than a line on their own. Default false. | - | SilkTextOptions.breakWords | text/SilkText.ts:82 |
caretWidth? | number | Caret width in screen pixels, whatever the zoom. Default 1.5. | - | - | ui/textedit.ts:102 |
dilate? | number | Grows (positive) or thins (negative) the glyphs, in local units. Default 0. | - | SilkTextOptions.dilate | text/SilkText.ts:92 |
element? | HTMLElement | The element the scene is drawn on, usually app.canvas. Positions the hidden text field at the caret, so input method popups open next to it. Default the element of the first press. | - | - | ui/textedit.ts:94 |
enter? | "blur" | "newline" | "commit" | What Enter does: insert a newline, commit (emits submit and change, keeps focus) or blur. Default newline for multi-line editors, commit for single-line ones. Shift + Enter always inserts a newline in multi-line editors, and cmd or ctrl + Enter commits and blurs. | - | - | ui/textedit.ts:76 |
fill? | ColorSource | Gradient | A colour, or a pixi-silk gradient over the text box (linear, radial and conic). Default white. | - | SilkTextOptions.fill | text/SilkText.ts:70 |
fontFamily? | string | CSS font family list. Default system-ui, -apple-system, Segoe UI, Roboto, sans-serif. | - | SilkTextOptions.fontFamily | text/SilkText.ts:62 |
fontSize? | number | Font size in local units. Default 16. | - | SilkTextOptions.fontSize | text/SilkText.ts:64 |
fontStyle? | "normal" | "italic" | "oblique" | normal, italic or oblique. Default normal. | - | SilkTextOptions.fontStyle | text/SilkText.ts:68 |
fontWeight? | string | number | CSS font weight. Default 400. | - | SilkTextOptions.fontWeight | text/SilkText.ts:66 |
handles? | boolean | Draggable handles at the ends of a selection made by touch. Default true. | - | - | ui/textedit.ts:98 |
history? | HistoryLike & { redo?: unknown; undo?: unknown; } | Where edits go for undo. Default a built-in History for this editor. Pass the app’s history to put text edits in line with its other steps. When it has undo() and redo(), cmd or ctrl + Z calls them while the editor has focus. | - | - | ui/textedit.ts:84 |
kerning? | boolean | Applies the font’s kerning (measured from Canvas). Default true. | - | SilkTextOptions.kerning | text/SilkText.ts:86 |
letterSpacing? | number | Extra space after each character, in local units. Default 0. | - | SilkTextOptions.letterSpacing | text/SilkText.ts:72 |
lineHeight? | number | Distance between baselines. 0 uses the font’s ascent plus descent, like PixiJS Text. Default 0. | - | SilkTextOptions.lineHeight | text/SilkText.ts:74 |
maxLength? | number | Longest text allowed, in UTF-16 code units like maxlength. Default no limit. | - | - | ui/textedit.ts:66 |
multiline? | boolean | Several lines (a text area) or one (an input). Default true. | - | - | ui/textedit.ts:57 |
outline? | TextOutline | null | A line around the glyphs. null for none. Default null. | - | SilkTextOptions.outline | text/SilkText.ts:88 |
placeholder? | string | Text shown while the editor is empty. | - | - | ui/textedit.ts:64 |
readOnly? | boolean | Clickable, selectable and copyable, but not editable. Default false. | - | - | ui/textedit.ts:68 |
selectable? | boolean | False leaves pointer input alone: no caret, no selection. Default true. | - | - | ui/textedit.ts:70 |
shadow? | TextShadow | null | A drop shadow or glow under the glyphs. null for none. Default null. | - | SilkTextOptions.shadow | text/SilkText.ts:90 |
tab? | "insert" | "next" | What Tab does: insert a tab character, or next (emits tab and blurs). Default next. | - | - | ui/textedit.ts:78 |
tabularNumbers? | boolean | Gives the digits one width, like font-variant-numeric: tabular-nums, for readouts. Default false. | - | SilkTextOptions.tabularNumbers | text/SilkText.ts:84 |
text? | string | Starting text. Default empty. | SilkTextOptions.text | - | ui/textedit.ts:55 |
theme? | Partial<TextEditorTheme> | Values that replace parts of TEXT_EDITOR_THEME. | - | - | ui/textedit.ts:100 |
ticker? | Ticker | null | Ticker driving the caret blink. Default Ticker.shared. null for manual TextEditor.tick. | - | - | ui/textedit.ts:104 |
width? | number | Fixed width in local units. A multi-line editor wraps at it. A single-line one clips its text and scrolls it to keep the caret in view. Default none: the box grows with the text. | - | - | ui/textedit.ts:62 |