Text Expander

Expands typed shortcuts into longer text when you press Space after a match. Useful for boilerplate phrases, signatures, or frequently used snippets.

Configure a map of shortcut → replacement strings. The plugin is inactive when items is false.

Load the bundle

<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/text-expander/text-expander.js"></script>

Initialization

const app = Redactor('#entry', {
    plugins: ['textExpander'],
    textExpander: {
        items: {
            sig: 'Best regards, Team',
            date: 'June 17, 2026'
        }
    }
});

Options

  • items (object | false)
    • default false
    • Shortcut map: key is the typed shortcut, value is the replacement text. The plugin is inactive when false.
Redactor('#entry', {
    plugins: ['textExpander'],
    textExpander: {
        items: {
            lorem: 'Lorem ipsum dolor sit amet.',
            email: '[email protected]'
        }
    }
});

Events

This plugin does not emit events.

API

This plugin does not expose a public API.