Contribute to this guide

Select all

The select all feature lets you select the entire content using the Ctrl/Cmd+A keystroke or a toolbar button. This way you can clear or copy all the content in one move.

# Demo

Press Ctrl/Cmd+A or use the toolbar button Select all to select the entire content of the editor.

When the selection is inside the image caption, it will only expand to the boundaries of the caption. Use the keystroke or the toolbar button again to include more content until the entire content of the editor is selected. The same rule applies when the selection is inside a table cell or any self–contained (nested) editable part of the content.

The great things you learn from traveling

A lone wanderer looking at Mount Bromo volcano in Indonesia.
Leaving your comfort zone might lead you to such beautiful sceneries like this one.

Like all the great things on earth traveling teaches us by example. Here are some of the most precious lessons I’ve learned over the years of traveling.

Appreciation of diversity

Getting used to an entirely different culture can be challenging. While it’s also nice to learn about cultures online or from books, nothing comes close to experiencing cultural diversity in person. You learn to appreciate each and every single one of the differences while you become more culturally fluid.

This demo presents a limited set of features. Visit the feature-rich editor example to see more in action.

# Installation

⚠️ New import paths

Starting with version 42.0.0, we changed the format of import paths. This guide uses the new, shorter format. Refer to the Packages in the legacy setup guide if you use an older version of CKEditor 5.

After installing the editor, add the feature to your plugin list and toolbar configuration:

import { ClassicEditor, SelectAll } from 'ckeditor5';

ClassicEditor
	.create( document.querySelector( '#editor' ), {
		licenseKey: '<YOUR_LICENSE_KEY>', // Or 'GPL'.
		plugins: [ SelectAll, /* ... */ ],
		toolbar: [ 'selectAll', /* ... */ ],
	} )
	.then( /* ... */ )
	.catch( /* ... */ );

# Common API

The SelectAll plugin registers the 'selectAll' UI button component and the 'selectAll' command implemented by SelectAllCommand.

You can execute the command using the editor.execute() method:

// Select the entire content of the editor.
editor.execute( 'selectAll' );

We recommend using the official CKEditor 5 inspector for development and debugging. It will give you tons of useful information about the state of the editor such as internal data structures, selection, commands, and many more.

# Contribute

The source code of the feature is available on GitHub at https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-select-all.