API reference
Intents
Intents: Asset
Intents: Content
Intents: Design
Intents: Test
Platform: Test

setDataFieldLabelVisibility

API reference for the setDataFieldLabelVisibility method.

This API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Controls whether data field labels are visible in the editor for the current app session. When enabled, users can see the purple labels indicating which data field each tagged element is linked to. The setting resets to hidden once the app session ends.

Usage: Show data field labels, then hide them again

import { setDataFieldLabelVisibility } from "@canva/design";
await setDataFieldLabelVisibility({ visible: true });
// User reviews data field labels in the editor.
await setDataFieldLabelVisibility({ visible: false });
TYPESCRIPT

Parameters

optsSetDataFieldLabelVisibilityOptions
Required

The configuration options for this call.

visibleboolean
Required

Whether data field labels should be visible in the editor for the current app session.

Returns

Response object from a setDataFieldLabelVisibility call. This is a Promise that resolves with the following object:

statusstring

The only valid value is "completed".