Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-text-align

Package Overview
Dependencies
Maintainers
5
Versions
172
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

  • 2.10.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
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

FAQs

Package last updated on 26 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc