Ritext
Extensions

Font Family

Change the font family of selected text.

The FontFamily extension adds a dropdown to the toolbar for selecting the font family of selected text.

Import

import { FontFamily } from 'ritext/extension/font-family';

Requirements

Requires TextStyle from base extensions.

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

const extensions = [TextStyle, FontFamily];

Usage

const extensions = [TextStyle, FontFamily];

Default Font Families

The following fonts are available by default:

  • Default (unset)
  • Inter
  • Comic Sans MS
  • Serif
  • Cursive
  • Arial
  • Arial Black
  • Georgia
  • Impact
  • Tahoma
  • Times New Roman
  • Verdana
  • Courier New
  • Lucida Console
  • Monaco
  • Monospace

Custom Font List

FontFamily.configure({
  fontFamilyList: [
    'Default',
    'Inter',
    'Georgia',
    { label: 'Custom Font', value: '"My Custom Font", sans-serif' },
    { label: 'Reset', value: null }, // null unsets the font
  ],
})

Options

Prop

Type

On this page