ValyroUI English version

Rich Text Editor

Редактор текста: Markdown-шорткаты, «/»-команды, упоминания, ссылки и картинки. Pro · Работа и команды › Команда и документы

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add rich-text-editor
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { RichTextEditor } from 'valyro-ui-pro';

Пропсы

PropTypeDefault
valueRichTextDocumentThe document (controlled). Pass back what onValueChange gives you.
defaultValueRichTextDocumentInitial value when uncontrolled.
onValueChange(value: RichTextDocument) => voidCalled with the new value when it changes.
placeholderstringHint shown in the first line while the document is empty.
readOnlybooleanfalseRenders the document without editing: no toolbars, menus or footer, and not a textbox for assistive tech.
autoFocusbooleanfalseFocus the text on mount (ignored when readOnly).
toolbarbooleantrueFixed formatting toolbar above the text (never in read-only mode). Default true.
bubbleToolbarbooleantrueFloating toolbar over selected text. Default true.
slashCommandsbooleantrue"/" at the start of a word opens a filterable menu of block types. Default true.
onMentionSearch(query: string) => RichTextMentionSuggestion[] | Promise<RichTextMentionSuggestion[]>Turns on @mentions: return the people matching the query (may be async).
onImageUpload(file: File) => Promise<string>Turns on image paste, drop and upload: store the file and resolve with its URL.
onSubmit(value: RichTextDocument) => void⌘↵ / Ctrl+Enter — e.g. to send a comment. Without it the shortcut ticks a to-do item.
maxLengthnumberCharacter limit (mentions count by their label). Typing and pasting stop there.
showCountbooleanWord and character count in the footer. Default: on when maxLength is set.
variant'outline' | 'plain''outline'outline — a framed field; plain — no frame or padding, for read-only rendering or your own card.
minHeightnumber | stringMinimum height of the text area; numbers are px, strings any CSS length.
maxHeightnumber | stringThe text scrolls inside the editor beyond this height.
footerReactNodeContent at the start of the footer, e.g. a Send button.
editorRefRef<HTMLDivElement>The contenteditable element.
localestringBCP 47 locale for the counter; defaults to the ThemeProvider's.
labelsPartial<RichTextEditorLabels>Overrides for the built-in English text; keys left out keep their defaults.

Похожие компоненты

  • Team Members — Участники команды: роли, приглашения по email, ожидающие инвайты, счётчик мест
  • Org Chart — Оргструктура: дерево с зумом и панорамой, поиск, сворачивание веток
  • Activity Feed — Лента активности
  • Calendar View — Календарь событий
  • Scheduler — Планировщик: день, неделя, месяц и таймлайн ресурсов, drag & drop, повторы
  • Kanban Board — Доска задач
  • Gantt Chart — Диаграммы Ганта с зависимостями и перетаскиванием
  • Booking Slots — Запись на встречу: календарь, слоты в часовом поясе гостя, форма и подтверждение
  • CRM Pipeline — Воронка сделок: этапы, суммы и вероятности, перетаскивание между этапами
  • Approval Flow — Многоэтапное согласование: последовательные и параллельные этапы, решения с причиной, история
  • Goal Tracker — OKR: цели и ключевые результаты, статусы, уверенность, чек-ины с историей
  • Onboarding Checklist — Чек-лист онбординга: прогресс, подсказки с CTA, скрытие и празднование

Назад: Activity Feed · Далее: Two Factor Setup · Весь раздел «Работа и команды»