Can anyone give me an example how to use Column? #3381
bahrijar
started this conversation in
Documentation
Replies: 1 comment
-
it's been months, but I hope this helps. you can use this template as the base // insert-drop-down-menu.tsx
const items = [{
items: [{
value: ColumnPlugin.key,
label: 'Column',
description: 'Column',
icon: Icons.ol, // this is not the correct icon, change it
}]
}];
// inside return of InsertDropdownMenu add another case
case ColumnPlugin.key: {
insertColumnGroup(editor);
break;
}
// plate-editor.tsx
export const useMyEditor = () => {
const editor = createPlateEditor({
plugins: [
// ...
ColumnPlugin,
ColumnItemPlugin,
// ...
]
override: {
components: withDraggables(
withPlaceholders({
[ColumnPlugin.key]: ColumnGroupElement,
[ColumnItemPlugin.key]: ColumnElement,
}),
)
}
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i already follow the instruction from the docs, but why when i insert the element, popover column group not appear, and the column only create 1 column
Beta Was this translation helpful? Give feedback.
All reactions