Text Editor
ProA rich text editor component with formatting toolbar and fonts.
vu-text-editor · @velkin/react-pro/text-editor
A rich text editor component with formatting toolbar and fonts.
vu-text-editor · @velkin/react-pro/text-editor
npm i @velkin/react-pro
import { LicenseInfo } from "@velkin/license";
// Vite: import.meta.env.VITE_VELKIN_LICENSE_KEY
// Next: process.env.NEXT_PUBLIC_VELKIN_LICENSE_KEY
LicenseInfo.setLicenseKey(import.meta.env.VITE_VELKIN_LICENSE_KEY ?? process.env.NEXT_PUBLIC_VELKIN_LICENSE_KEY ?? "");
// @velkin-pro
import { VuTextEditor } from "@velkin/react-pro/text-editor";| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | "" | Text content. |
| editorStyle | Partial | {} | External style seed merged into the editor. |
| presets | VuTextEditorPresets | {} | Preset lists for toolbar selects. |
| useLocalFonts | boolean | false | Enables `queryLocalFonts()` on font field focus. |
| variant | VuTextEditorVariant | "default" | Field chrome recipe. |
| tone | VuTextEditorTone | "normal" | Neutral chrome weight. |
| size | VuTextEditorSize | "md" | Toolbar + textarea scale. |
| radius | VuTextEditorRadius | "md" | Corner preset (`none`/`sm`/`md`/`lg`/`full`). Default: `md`. |
| block | boolean | false | Stretches to container width. |
| disabled | boolean | false | Disables editing and toolbar controls. |
| readonly | boolean | false | Keeps focus but blocks edits. |
| label | string | "" | Plain-text label fallback. |
| placeholder | string | "" | Textarea placeholder. |
| clearlabel | string | "" | Clear text action label override. |
| resetstylelabel | string | "" | Reset styles action label override. |
| arialabel | string | "" | Accessible name when no visible label is provided. |
| Event | Detail | Description |
|---|---|---|
| vu-change | VuTextEditorChangeDetail | When `value` or `style` changes. |
| Slot | Description |
|---|---|
| label | Rich label markup; takes precedence over string `label` when assigned. |
| Part | Description |
|---|---|
| field | Column stacking label and editor shell. |
| label | Visible label element. |
| container | Bordered editor shell (toolbar + body). |
| toolbar | Formatting toolbar row. |
| toolbar-divider | Hairline between toolbar and editor body. |
| toolbar-select | Toolbar `vu-combobox` controls. |
| body | Textarea container region. |
| textarea | Editable textarea surface. |
| actions | Reset action cluster. |
| Method | Description |
|---|---|
| getValue | - Returns current text content. |
| setValue | - Sets text content. |
| getStyle | - Returns the active editor style object. |
| focus | - Focuses the textarea. |
| Name | Definition |
|---|---|
| VuTextEditorChangeDetail | |
| VuTextEditorPresets | |
| VuTextEditorRadius | |
| VuTextEditorSize | |
| VuTextEditorTone | |
| VuTextEditorVariant | |