Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@tiptap/extension-text-align
Advanced tools
@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.
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();
Quill is a powerful, free, open-source WYSIWYG editor with a rich API. It provides text alignment functionalities similar to @tiptap/extension-text-align, but it is a standalone editor rather than an extension.
Draft.js is a framework for building rich text editors in React. It offers text alignment features through its API, similar to @tiptap/extension-text-align, but it requires more setup and configuration.
Slate is a completely customizable framework for building rich text editors. It provides text alignment capabilities similar to @tiptap/extension-text-align, but it is more flexible and requires more manual configuration.
tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the tiptap website.
tiptap is open-sourced software licensed under the MIT license.
FAQs
text align extension for tiptap
The npm package @tiptap/extension-text-align receives a total of 184,992 weekly downloads. As such, @tiptap/extension-text-align popularity was classified as popular.
We found that @tiptap/extension-text-align demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.