Ritext
Extensions

Color

Apply a text color to selected content.

The Color extension adds a color picker dropdown to the toolbar for changing the text color of selected content.

Import

import { Color } from 'ritext/extension/color';

Requirements

Requires TextStyle from base extensions.

import { TextStyle } from 'ritext/extension/base';

const extensions = [TextStyle, Color];

Usage

const extensions = [TextStyle, Color];

Features

  • 70 preset colors organized in 7 groups
  • Recent colors panel (up to 10 colors, stored in localStorage)
  • Custom color picker via hex input

Custom Color List

Color.configure({
  colorLists: [
    '#000000', '#ffffff', '#ff0000',
    '#00ff00', '#0000ff', '#ffff00',
    '#ff00ff', '#00ffff',
  ],
})

Options

Prop

Type

On this page