Skip to main content
The Strike extension allows you to mark text with strikethrough formatting. Text is rendered as an <s> HTML element by default.

Installation

npm install @tiptap/extension-strike

Usage

import { Editor } from '@tiptap/core'
import Strike from '@tiptap/extension-strike'

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

Keyboard Shortcuts

  • Mod-Shift-s - Toggle strikethrough formatting

Markdown Support

The extension supports markdown syntax for strikethrough text:
  • Type ~~text~~ to create strikethrough text

Configuration Options

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

Commands

setStrike()

Set a strike mark on the current selection.
editor.commands.setStrike()

toggleStrike()

Toggle the strike mark on the current selection.
editor.commands.toggleStrike()

unsetStrike()

Remove the strike mark from the current selection.
editor.commands.unsetStrike()

Source Code

View the source code on GitHub: