本文档介绍了 WordPress 组件库中的 Placeholder 组件,用于在界面中显示占位内容,支持图标、标签、指令等属性配置。
import { Placeholder } from '@wordpress/components';
import { more } from '@wordpress/icons';
const MyPlaceholder = () => <Placeholder icon={ more } label="Placeholder" />; import { Placeholder } from '@wordpress/components';
import { more } from '@wordpress/icons';
const MyPlaceholder = () => <Placeholder icon={ more } label="Placeholder" />;
className: stringClass to set on the container div.
icon: string|Function|Component|nullIf provided, renders an icon next to the label.
instructions: stringInstructions of the placeholder.
isColumnLayout: booleanChanges placeholder children layout from flex-row to flex-column.
label: stringTitle of the placeholder.
notices: ReactNodeA rendered notices list
preview: ReactNodePreview to be rendered in the placeholder.
withIllustration: booleanOutputs a placeholder illustration.