Divider 是一个用于分隔相关内容组的布局组件,目前处于实验阶段,这意味着其实现可能发生重大变更。
import {
__experimentalDivider as Divider,
} from `@wordpress/components`;
import { Stack } from '@wordpress/ui';
function Example() {
return (
<Stack direction="column" gap="lg">
<span>Some text here</span>
<Divider />
<span>Some more text here</span>
</Stack>
);
}Divider is a layout component that separates groups of related content.
import {
__experimentalDivider as Divider,
} from `@wordpress/components`;
import { Stack } from '@wordpress/ui';
function Example() {
return (
<Stack direction="column" gap="lg">
<span>Some text here</span>
<Divider />
<span>Some more text here</span>
</Stack>
);
}
margin: numberAdjusts all margins on the inline dimension.
marginEnd: numberAdjusts the inline-end margin.
marginStart: numberAdjusts the inline-start margin.
orientation: horizontal | verticalDivider’s orientation. When using inside a flex container, you may need to make sure the divider is stretch aligned in order for it to be visible.
horizontalDivider also inherits all of the Separator props.