EditorDragHandle
A handle beside the block under the pointer that drags it to a new place. Alt and the arrow keys move a block from the keyboard.
On this page
Examples
Drag a block
The handle is hidden below the sm breakpoint; the keyboard shortcuts and the MoveUp and MoveDown toolbar buttons still work.
One
Two
Three
Drag a block by its handle. From the keyboard, use Alt and the up or down arrow in the text.
Razor
<div class="ms-8 flex w-full max-w-2xl flex-col gap-3">
<KlyFormField Label="Blocks" Help="Drag a block by its handle. From the keyboard, use Alt and the up or down arrow in the text.">
<KlyEditor Value="@("<p>One</p><p>Two</p><p>Three</p>")" Name="blocks" data-testid="editor-drag">
<KlyEditorDragHandle />
</KlyEditor>
</KlyFormField>
</div>API
KlyEditorDragHandle
Handle that drags a block of the editor, or moves it with Alt and the arrow keys.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Color |
KlyColor |
"primary" |
Semantic color of the handle: a built-in KlyColor or the name of a color you defined. Values: primary, secondary, success, info, warning, error, neutral. |
Label |
string |
Accessible name of the handle. Defaults to EditorDragHandle . The handle shows beside the block under the pointer or holding the cursor, and drags it. The keyboard alternative is Alt and the up or down arrow in the text (or the arrows on the focused handle), and the MoveUp and MoveDown toolbar buttons. | |
Ui |
Editor |
Per-instance class overrides of the slots of the editor drag handle, see EditorDragHandleUi . They are merged after the theme and the Class parameter wins on the root slot. |
Ui slots
Ui takes a Editor with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyEditorDragHandle , after the theme and the app configuration. |
Handle |
Classes merged into the handle slot of KlyEditorDragHandle , after the theme and the app configuration. |
Icon |
Classes merged into the icon slot of KlyEditorDragHandle , after the theme and the app configuration. |