ControlProps

Interface of @saij/wp-app-framework, for type checks in your IDE.

export interface ControlProps<V = unknown> extends BlockProps {
	value: V;
	onChange: (value: V) => void;
}

Props of a control registered with registerControl() or registerSupportControl().

Members

value

value: V

The value of the attribute the control replaces.

onChange

onChange: (value: V) => void

Sets the value of the attribute.

attributes

attributes: Attributes

The attributes of the block.

setAttributes

setAttributes: (attributes: Attributes) => void

Changes attributes of the block, like setAttributes of a block's edit component in WordPress.

clientId

clientId: string

The client ID of the block in the editor.

isPreview

isPreview: boolean

Whether the block shows its front-end preview (toolbar button "Preview") instead of the editable fields.