openpencil/packages/docs/programmable/sdk/api/composables/use-export.md
2026-03-24 23:24:08 +03:00

840 B

title description
useExport Manage export settings like scale and format for the current selection.

useExport

useExport() is the export-panel composable for selected nodes.

It manages:

  • export settings rows
  • selected node ids
  • export name labeling
  • supported scales and formats

Usage

import { useExport } from '@open-pencil/vue'

const exportState = useExport()

Basic example

const {
  settings,
  nodeName,
  scales,
  formats,
  addSetting,
  updateScale,
  updateFormat,
} = useExport()

Practical examples

Add another export preset

exportState.addSetting()

Change the first export to 2x WEBP

exportState.updateScale(0, 2)
exportState.updateFormat(0, 'WEBP')