Clips

Create a list of frequently used snippets of code, text, icons, emoji, you name it.

    Demo

    Click on any editable block and see the clips icon on the toolbar.

    Code

    <!DOCTYPE html>
    <html>
        <head>
            <title>Redactor X</title>
            <meta charset="utf-8">
    
            <!-- css -->
            <link rel="stylesheet" href="/your-folder/redactorx.css" />
    
            <!-- style your clips -->
            <style>
            .label-red {
                background-color: red;
                color: white;
                display: inline-block;
                line-height: 1;
                padding: 4px 10px;
                border-radius: 6px;
            }
            </style>
        </head>
        <body>
            <!-- element -->
            <textarea id="entry">...</textarea>
    
            <!-- js -->
            <script src="/your-folder/redactorx.js"></script>
            <script src="/your-folder/plugins/clips.js"></script>
    
            <!-- call -->
            <script>
            RedactorX('#entry', {
                plugins: ['clips'],
                clips: {
                    items: {
                        "lorem-ipsum": {
                            title: 'Lorem ipsum...',
                            html: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
                        },
                        "label-red": {
                            title: 'Red label',
                            html: '<b class="label-red">Label</b>'
                        }
                    }
                }
            });
            </script>
        </body>
    </html>