Skip to content

Commit 890c484

Browse files
author
Rajat Saxena
committed
Custom toolbar
1 parent d516b44 commit 890c484

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

packages/text-editor/src/Renderer/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const typeMap: MarkMap = {
3232
text: TextHandler,
3333
taskList: "ul",
3434
taskListItem: "li",
35+
// add links to headings for table of contents navigation
3536
heading: ({ node, children }) => {
3637
if (!node.content) {
3738
return null;
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
import React, { FC } from "react";
2-
import { Toolbar as RemirrorToolbar } from "@remirror/react-ui";
2+
import {
3+
FormattingButtonGroup,
4+
HeadingLevelButtonGroup,
5+
ListButtonGroup,
6+
RedoButton,
7+
Toolbar as RemirrorToolbar,
8+
ToggleBlockquoteButton,
9+
UndoButton,
10+
} from "@remirror/react-ui";
311

412
const Toolbar: FC = () => {
5-
return <RemirrorToolbar></RemirrorToolbar>;
13+
return (
14+
<RemirrorToolbar>
15+
<UndoButton />
16+
<RedoButton />
17+
<HeadingLevelButtonGroup showAll />
18+
<FormattingButtonGroup>
19+
<ToggleBlockquoteButton />
20+
</FormattingButtonGroup>
21+
<ListButtonGroup />
22+
</RemirrorToolbar>
23+
);
624
};
725

826
export default Toolbar;

0 commit comments

Comments
 (0)