aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx')
-rw-r--r--apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx b/apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx
new file mode 100644
index 00000000..aa200eaa
--- /dev/null
+++ b/apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx
@@ -0,0 +1,17 @@
+'use client';
+
+import { createPlatePlugin } from '@udecode/plate-common/react';
+
+import { FloatingToolbar } from '~/components/plate-ui/floating-toolbar';
+import { FloatingToolbarButtons } from '~/components/plate-ui/floating-toolbar-buttons';
+
+export const FloatingToolbarPlugin = createPlatePlugin({
+ key: 'floating-toolbar',
+ render: {
+ afterEditable: () => (
+ <FloatingToolbar>
+ <FloatingToolbarButtons />
+ </FloatingToolbar>
+ ),
+ },
+});