Column
Add Columns to your document.
🌻 Column
Installation
npm install @udecode/plate-layoutUsage
// ...
import { createColumnPlugin } from '@udecode/plate-layout';
const plugins = [
// ...otherPlugins,
createColumnPlugin(),
];API
createColumnPlugin
Add Column Plugin to your document.
TColumnGroupElement
Attributes
Extends TElement.
Set the width of it’s children Column
TColumnElement
Attributes
Extends TElement.
The Column's width end with %
insertColumnGroup
Insert an columnGroup with two empty column.
Parameters
The editor instance.
insertEmptyColumn
Insert an empty column. You can set the with by options.width default is "33%"
Parameters
The editor instance.
InsertNodesOptions and with to set the insert behavior.
moveMiddleColumn
Move the middle column to the left of right by options.direction. if the middle node is empty return false and remove it.
Parameters
The editor instance.
The node entry of column element
Control the middle column move to
setColumnWidth
Set the width of ColumnGroup's children.In general you don't need to use this function,Since we will call this function automatically when the property of layout changed.
If you want to set the layout use setNodes.
Parameters
The editor instance.
the path ref of ColumnGoup
The element property of layout
API Components
useColumnState
Returns
Call this function make the ColumnGroup's children, column bisects the
parent element space.This nature is set the layout property of
ColumnGroup to [50,50]
Set the layout property of ColumnGroup to [33, 33, 33]
Set the layout property of ColumnGroup to [70,30]
Set the layout property of ColumnGroup to [30,70]
Set the layout property of ColumnGroup to [25, 50, 25]
useDebouncePopoverOpen
Returns
popover is open or not