Options for customizing the editor’s UI mode
Editor in scrollable container
ui_mode
This feature is only available for TinyMCE 6.4 and later. |
This option configures the location of all the UI elements that should scroll with the editor, such as popups, menus and inline dialogs.
By default, these UI elements are rendered in a container that is attached to the document body, meaning they are not connected to any scrollable containers the editor might be in.
When the editor is rendered in a scrollable container, scrolling the editor’s container will cause these UI elements to be detached from the anchor.
If toolbar_sticky
is set to true, the sticky toolbar and the menus have no effect on docking when scrolling the editor’s container; they are only triggered when the page is scrolled.
However, setting this option to 'split'
enables support for editors in scrollable containers and adjusts the behaviour as follows:
-
Popups, menus and inline dialogs are rendered in a separate container and inserted as a sibling to the editor. These UI elements move together as you scroll the editor’s container.
-
If
toolbar_sticky
is set to true, the UI element can be docked on both page and container scroll. This means the UI element will stay in the same place relative to the container, regardless of how much you scroll the page or the container itself.
Type: String
Default value: 'combined'
Possible values: 'combined'
, 'split'
Example: using ui_mode
tinymce.init({
selector: 'textarea', // change this value according to your HTML
ui_mode: 'split',
min_height: 500
});
Interactive example
-
TinyMCE
-
HTML
-
CSS
-
JS
-
Edit on CodePen
Classic (iframe) editor in a scrollable container
Inline editor in a scrollable container
The world’s first rich text editor in the cloud
Have you heard about Tiny Cloud? It’s the first step in our journey to help you deliver great content creation experiences, no matter your level of expertise. 50,000 developers already agree. They get free access to our global CDN, image proxy services and auto updates to the TinyMCE editor. They’re also ready for some exciting updates coming soon.
One of these enhancements is Tiny Drive: imagine file management for TinyMCE, in the cloud, made super easy. Learn more at tiny.cloud/drive/, where you’ll find a working demo and an opportunity to provide feedback to the product team.
An editor for every project
Here are some of our customer’s most common use cases for TinyMCE:
- Content Management Systems (e.g. WordPress, Umbraco)
- Learning Management Systems (e.g. Blackboard)
- Customer Relationship Management and marketing automation (e.g. Marketo)
- Email marketing (e.g. Constant Contact)
- Content creation in SaaS systems (e.g. Eventbrite, Evernote, GoFundMe, Zendesk)
And those use cases are just the start. TinyMCE is incredibly flexible, and with hundreds of APIs there’s likely a solution for your editor project. If you haven’t experienced Tiny Cloud, get started today. You’ll even get a free trial of our premium plugins – no credit card required!
<h3>Classic (iframe) editor in a scrollable container</h3>
<div class="scrollable-container">
<textarea id="iframe">
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Tiny Logo" src="https://www.tiny.cloud/docs/images/logos/android-chrome-256x256.png" alt="TinyMCE Logo" width="128" height="128"></p>
</p>
<h2 style="text-align: center;">Welcome to the TinyMCE Cloud demo!</h2>
<h5 style="text-align: center;">Note, this includes some "enterprise/premium" features.<br>Visit the <a href="https://www.tiny.cloud/pricing">pricing page</a> to learn more about our premium plugins.</h5>
<p>Please try out the features provided in this full featured example.</p>
<h2>Got questions or need help?</h2>
<ul>
<li>Our <a href="https://www.tiny.cloud/docs/tinymce/6/">documentation</a> is a great resource for learning how to configure TinyMCE.</li>
<li>Have a specific question? Try the <a href="https://stackoverflow.com/questions/tagged/tinymce" target="_blank" rel="noopener"><code>tinymce</code> tag at Stack Overflow</a>.</li>
<li>We also offer enterprise grade support as part of <a href="https://www.tiny.cloud/pricing">TinyMCE premium subscriptions</a>.</li>
</ul>
<h2>A simple table to play with</h2>
<table style="border-collapse: collapse; width: 100%;" border="1">
<thead>
<tr>
<th>Product</th>
<th>Cost</th>
<th>Really?</th>
</tr>
</thead>
<tbody>
<tr>
<td>TinyMCE Cloud</td>
<td>Get started for free</td>
<td>YES!</td>
</tr>
<tr>
<td>Plupload</td>
<td>Free</td>
<td>YES!</td>
</tr>
</tbody>
</table>
<h2>Found a bug?</h2>
<p>If you think you have found a bug please create an issue on the <a href="https://github.com/tinymce/tinymce/issues">GitHub repo</a> to report it to the developers.</p>
<h2>Finally ...</h2>
<p>Don't forget to check out our other product <a href="http://www.plupload.com" target="_blank">Plupload</a>, your ultimate upload solution featuring HTML5 upload support.</p>
<p>Thanks for supporting TinyMCE! We hope it helps you and your users create great content.<br>All the best from the TinyMCE team.</p>
</textarea>
</div>
<h3>Inline editor in a scrollable container</h3>
<div class="scrollable-container">
<div class="demo-inline">
<div class="container">
<p><img src="../_images/tiny-banner.png" style="width: 100%;"/></p>
<h1 class="tinymce-heading">The world’s first rich text editor in the cloud</h1>
<p><img src="https://www.tiny.cloud/images/image-two.jpg"/></p>
<div class="tinymce-body">
<p>Have you heard about Tiny Cloud? It’s the first step in our journey to help you deliver great content creation experiences, no matter your level of expertise. 50,000 developers already agree. They get free access to our global CDN, image proxy services and auto updates to the TinyMCE editor. They’re also ready for some exciting updates coming soon.</p>
<p>One of these enhancements is <strong>Tiny Drive</strong>: imagine file management for TinyMCE, in the cloud, made super easy. Learn more at <a href="https://www.tiny.cloud/drive/">tiny.cloud/drive/</a>, where you’ll find a working demo and an opportunity to provide feedback to the product team.</p>
</div>
</div>
<h2 class="tinymce-heading">An editor for every project</h2>
<div class="tinymce-body">
<p>Here are some of our customer’s most common use cases for TinyMCE:</p>
<ul>
<li>Content Management Systems (<em>e.g. WordPress, Umbraco</em>)</li>
<li>Learning Management Systems (<em>e.g. Blackboard</em>)</li>
<li>Customer Relationship Management and marketing automation (<em>e.g. Marketo</em>)</li>
<li>Email marketing (<em>e.g. Constant Contact</em>)</li>
<li>Content creation in SaaS systems (<em>e.g. Eventbrite, Evernote, GoFundMe, Zendesk</em>)</li>
</ul>
<p>And those use cases are just the start. TinyMCE is incredibly flexible, and with hundreds of APIs there’s likely a solution for your editor project. If you haven’t experienced Tiny Cloud, get started today. You’ll even get a free trial of our premium plugins – no credit card required!</p>
</div>
</div>
</div>
.scrollable-container {
height: 300px;
overflow: scroll;
}
.my-inline-editor {
margin: 12px;
}
const settings = {
plugins: 'lists help',
toolbar: 'undo redo | blocks | bold italic | bullist numlist',
ui_mode: 'split',
min_height: 500
};
tinymce.init({
...settings,
selector: 'textarea#iframe'
});
tinymce.init({
...settings,
inline: true,
selector: '.tinymce-heading',
inline: true,
toolbar: 'undo redo | bold italic underline'
});
tinymce.init({
...settings,
selector: '.tinymce-body',
inline: true
});