![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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.
2.0.0 (2023-03-29)
i
in defaultBlockAt
by @andreavaccari in https://github.com/ueberdosis/tiptap/pull/1315Color
extension to set the text color by @hanspagel in https://github.com/ueberdosis/tiptap/pull/1744this.value
to value
in the vue examples with v-model by @MiloLug in https://github.com/ueberdosis/tiptap/pull/1813ReactRenderer
types by @rfgamaral in https://github.com/ueberdosis/tiptap/pull/2011editor
dependency when registering BubbleMenuPlugin
by @ValentaTomas in https://github.com/ueberdosis/tiptap/pull/2018defaultOptions
with addOptions
by @philippkuehn in https://github.com/ueberdosis/tiptap/pull/2088CollaborationCursor
extension by @hanspagel in https://github.com/ueberdosis/tiptap/pull/2096enableInputRules
and enablePasteRules
by @aguingand in https://github.com/ueberdosis/tiptap/pull/2119setEditable
to the Editor documentation by @floriankrueger in https://github.com/ueberdosis/tiptap/pull/2199as
option and pass through to ReactRenderer by @jessicalc in https://github.com/ueberdosis/tiptap/pull/2213createView
by @BrianHung in https://github.com/ueberdosis/tiptap/pull/2212type="context"
tag by @duruer in https://github.com/ueberdosis/tiptap/pull/2240CharacterCount
extension by @philippkuehn in https://github.com/ueberdosis/tiptap/pull/2256element.current
from useEffect
in BubbleMenu
and FloatingMenu
by @ValentaTomas in https://github.com/ueberdosis/tiptap/pull/2297Level
for external use by @webri in https://github.com/ueberdosis/tiptap/pull/2354@tiptap/react
and @tiptap/core
as side effect free by @dcastil in https://github.com/ueberdosis/tiptap/pull/2361javascript:
pseudo-protocol by @phenax in https://github.com/ueberdosis/tiptap/pull/2646onBeforeStart
and onBeforeUpdate
handlers to the render function by @rfgamaral in https://github.com/ueberdosis/tiptap/pull/2628getTextSerializersFromSchema
helper, and fix typo in its name by @sjdemartini in https://github.com/ueberdosis/tiptap/pull/2750className
option and pass through to ReactRenderer by @anton-liubushkin in https://github.com/ueberdosis/tiptap/pull/2794Avoid mutating a prop directly
error message to reproduce by @HondryTravis in https://github.com/ueberdosis/tiptap/pull/2834@tiptap/extension-code-block-lowlight
by @enriquecastl in https://github.com/ueberdosis/tiptap/pull/2625whiteSpace
style for NodeViewWrapper
& NodeViewContent
by @EvitanRelta in https://github.com/ueberdosis/tiptap/pull/2884nodeInputRule
by @ahhshm in https://github.com/ueberdosis/tiptap/pull/2954flushSync
to microtask by @sampi in https://github.com/ueberdosis/tiptap/pull/3188editor.setEditable
to omit updates by @ZaymonFC in https://github.com/ueberdosis/tiptap/pull/3301nodePasteRule
find
type to most generic PasteRuleFinder
by @jiegillet in https://github.com/ueberdosis/tiptap/pull/3759createNodeFromContent
and other missing helpers by @jacksleight in https://github.com/ueberdosis/tiptap/pull/3558documentClear
plugin by @thecodrr in https://github.com/ueberdosis/tiptap/pull/3778FAQs
text align extension for tiptap
The npm package @tiptap/extension-text-align receives a total of 161,174 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 6 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.