Skip to content

Font Size

The Font Size extension allows you to change the font size of your editor.

Usage

tsx
import { FontSize } from 'reactjs-tiptap-editor'; 

const extensions = [
  ...,
  // Import Extensions Here
  FontSize 
];

Options

fontSizes

Type: (string | { value: string; name: string })[]

js
import { DEFAULT_FONT_SIZE_LIST, FontSize } from 'reactjs-tiptap-editor'

FontSize.configure({
  fontSizes: [
    // Use default font size list
    ...DEFAULT_FONT_SIZE_LIST,
    // Two formats
    //   1. string
    //   2. { name: 'xxx', value: 'xxx' }

    '10px',
    { name: '200 pixel', value: '200px' }
  ]
})

Source

SourceDocs

Contributors

Changelog

v0.0.10 on 8/19/2024
867ce - feat(FontSize): Add options support for FontSize extension

Made with ❤️