Components
Indent List Toolbar Button
Indent List Toolbar Button
Indent list items to create nested or hierarchical lists.
Installation
npx @udecode/plate-ui@latest add indent-list-toolbar-button
Examples
Indent List
Create indented lists with multiple levels of indentation and customize the list style type for each level.
- Roman 1
- Decimal 11
- Decimal 111
- Decimal 112
- Decimal 12
- Decimal 13
- Roman 2
- Decimal 11
- Decimal 12
- Roman 3
- Roman 4
import React from 'react';
import {
MARK_BOLD,
MARK_CODE,
MARK_ITALIC,
MARK_STRIKETHROUGH,
MARK_UNDERLINE,
} from '@udecode/plate-basic-marks';
import { useEditorReadOnly } from '@udecode/plate-common';
import { Icons } from '@/components/icons';
import { InsertDropdownMenu } from './insert-dropdown-menu';
import { MarkToolbarButton } from './mark-toolbar-button';
import { ModeDropdownMenu } from './mode-dropdown-menu';
import { ToolbarGroup } from './toolbar';
import { TurnIntoDropdownMenu } from './turn-into-dropdown-menu';
export function FixedToolbarButtons() {
const readOnly = useEditorReadOnly();
return (
<div className="w-full overflow-hidden">
<div
className="flex flex-wrap"
style={{
transform: 'translateX(calc(-1px))',
}}
>
{!readOnly && (
<>
<ToolbarGroup noSeparator>
<InsertDropdownMenu />
<TurnIntoDropdownMenu />
</ToolbarGroup>
<ToolbarGroup>
<MarkToolbarButton tooltip="Bold (⌘+B)" nodeType={MARK_BOLD}>
<Icons.bold />
</MarkToolbarButton>
<MarkToolbarButton tooltip="Italic (⌘+I)" nodeType={MARK_ITALIC}>
<Icons.italic />
</MarkToolbarButton>
<MarkToolbarButton
tooltip="Underline (⌘+U)"
nodeType={MARK_UNDERLINE}
>
<Icons.underline />
</MarkToolbarButton>
<MarkToolbarButton
tooltip="Strikethrough (⌘+⇧+M)"
nodeType={MARK_STRIKETHROUGH}
>
<Icons.strikethrough />
</MarkToolbarButton>
<MarkToolbarButton tooltip="Code (⌘+E)" nodeType={MARK_CODE}>
<Icons.code />
</MarkToolbarButton>
</ToolbarGroup>
</>
)}
<div className="grow" />
<ToolbarGroup noSeparator>
<ModeDropdownMenu />
</ToolbarGroup>
</div>
</div>
);
}