Socket
Book a DemoInstallSign in
Socket

@tiptap/extension-text-align

Package Overview
Dependencies
Maintainers
5
Versions
254
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-text-align

text align extension for tiptap

latest
Source
npmnpm
Version
3.4.2
Version published
Weekly downloads
840K
8.58%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-text-align?

@tiptap/extension-text-align is an extension for the Tiptap editor that allows you to align text within your editor. It provides functionalities to align text to the left, center, right, or justify it. This extension is useful for creating rich text editors where text alignment is a necessary feature.

What are @tiptap/extension-text-align's main functionalities?

Align Text Left

This feature allows you to align text to the left. The code sample demonstrates how to configure the TextAlign extension to apply to headings and paragraphs, and then align the text to the left.

import { TextAlign } from '@tiptap/extension-text-align';

const editor = new Editor({
  extensions: [
    TextAlign.configure({
      types: ['heading', 'paragraph'],
    }),
  ],
});

editor.chain().focus().setTextAlign('left').run();

Align Text Center

This feature allows you to align text to the center. The code sample demonstrates how to configure the TextAlign extension to apply to headings and paragraphs, and then align the text to the center.

import { TextAlign } from '@tiptap/extension-text-align';

const editor = new Editor({
  extensions: [
    TextAlign.configure({
      types: ['heading', 'paragraph'],
    }),
  ],
});

editor.chain().focus().setTextAlign('center').run();

Align Text Right

This feature allows you to align text to the right. The code sample demonstrates how to configure the TextAlign extension to apply to headings and paragraphs, and then align the text to the right.

import { TextAlign } from '@tiptap/extension-text-align';

const editor = new Editor({
  extensions: [
    TextAlign.configure({
      types: ['heading', 'paragraph'],
    }),
  ],
});

editor.chain().focus().setTextAlign('right').run();

Justify Text

This feature allows you to justify text. The code sample demonstrates how to configure the TextAlign extension to apply to headings and paragraphs, and then justify the text.

import { TextAlign } from '@tiptap/extension-text-align';

const editor = new Editor({
  extensions: [
    TextAlign.configure({
      types: ['heading', 'paragraph'],
    }),
  ],
});

editor.chain().focus().setTextAlign('justify').run();

Other packages similar to @tiptap/extension-text-align

Keywords

tiptap

FAQs

Package last updated on 09 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts