Skip to content

Dialog

Terminal window
carbon add plugin Dialog
import { dialog } from '@dotcarbon/plugin-dialog'
const files = await dialog.openFile({
title: 'Import profiles',
multiple: true,
filters: ['json'],
})
const destination = await dialog.saveFile({ defaultName: 'profile.json' })
const folder = await dialog.openFolder({ title: 'Choose output folder' })
const accepted = await dialog.confirm('Replace the existing profile?')
await dialog.message('Import complete', { title: 'Carbon', kind: 'info' })

Dialog instances are bound to the calling desktop window so native sheets and ownership behave correctly.