Skip to main content

sdk.objectapi.sethiddenstate

Home > @kittl/sdk > ObjectAPI > setHiddenState

ObjectAPI.setHiddenState() method

Hides or shows an object in the design canvas.

When an object is hidden, it is not rendered on the canvas and is invisible to the user. However, the object remains in the design state and can be shown again later.

Signature:

setHiddenState(params: SetHiddenParams, opts?: DesignApiOptions): WithHidden;

Parameters

Parameter

Type

Description

params

SetHiddenParams

Configuration parameters for hiding the object

opts

DesignApiOptions

(Optional) Additional options for the design API operation

Returns:

WithHidden

Result object containing the updated object with hidden state

Exceptions

When the specified object ID is not found in the design state

When the object ID is invalid or empty

Example

const objectApi = new ObjectAPI(projectManager, store);

// Hide an object
const result = await objectApi.setHiddenState({
id: 'decorative-element-123',
hidden: true
});
// result: { id: 'decorative-element-123', hidden: true }