RichTextEditorContent
TheRichTextEditorContent component is a read-only rich text editor that safely renders user-generated content. It uses Tiptap’s EditorProvider with a predefined set of extensions to display formatted content without allowing editing.
Props
The HTML content string to render. This should be the raw content from the WellPlayed API.
Optional CSS styles to apply to the wrapper div container.
Usage Example
Included Tiptap Extensions
The component comes pre-configured with the following Tiptap extensions:-
StarterKit - Provides basic editing functionality including:
- Bold, italic, and code formatting
- Headings (h1-h6)
- Paragraphs
- Bullet and ordered lists
- Blockquotes
- Code blocks
- Horizontal rules
- Hard breaks
- History (undo/redo)
- Underline - Adds underline text formatting support
- Superscript - Enables superscript text (e.g., x²)
- Subscript - Enables subscript text (e.g., H₂O)
- Highlight - Allows text highlighting with background colors
- TextAlign - Enables text alignment for headings and paragraphs (left, center, right, justify)
Type Definition
Notes
- The component is read-only (
editable={false}) and should only be used to display content, not edit it. - Use this component to securely render user-generated content from tournament descriptions, event descriptions, and other rich text fields from the WellPlayed API.
- The component handles all necessary sanitization through Tiptap’s built-in security features.