Skip to content

AI-native design editor. Open-source Figma alternative.

804 B
Raw Blame

title: useMask description: Read and update mask state for the selected node.

useMask

useMask() provides headless state and actions for mask controls in a property panel.

Usage

import { useMask } from '@open-pencil/vue/controls/mask'

const { active, maskType, setMaskType } = useMask()
  • active is true when exactly one selected node is being used as a mask.
  • maskType is the selected node's ALPHA, VECTOR, or LUMINANCE mask type.
  • setMaskType(type) updates the active mask with undo support.

Use the selection.toggleMask editor command to turn masking on or off so toolbar, context-menu, and keyboard behavior stays consistent.

Related APIs