Skip to main content
The Italic extension allows you to mark text as italic. Text is rendered as an <em> HTML element by default.

Installation

npm install @tiptap/extension-italic

Usage

import { Editor } from '@tiptap/core'
import Italic from '@tiptap/extension-italic'

const editor = new Editor({
  extensions: [
    Italic,
  ],
})

Keyboard Shortcuts

  • Mod-i or Mod-I - Toggle italic formatting

Markdown Support

The extension supports markdown syntax for italic text:
  • Type *text* to create italic text
  • Type _text_ to create italic text

Configuration Options

HTMLAttributes
Record<string, any>
default:"{}"
HTML attributes to add to the italic element.
Italic.configure({
  HTMLAttributes: {
    class: 'my-italic-class',
  },
})

Commands

setItalic()

Set an italic mark on the current selection.
editor.commands.setItalic()

toggleItalic()

Toggle the italic mark on the current selection.
editor.commands.toggleItalic()

unsetItalic()

Remove the italic mark from the current selection.
editor.commands.unsetItalic()

Source Code

View the source code on GitHub: