WidgetDrawer

Widget drawer modal wrapper component that handles widget initialization internally

Installation

import { WidgetDrawer } from 'uxp/components';

Signature

const WidgetDrawer: React.FunctionComponent<WidgetDrawerProps>

Examples

tsx
<WidgetDrawer
  show={showDrawer}
  onClose={() => setShowDrawer(false)}
  widgets={dashboardWidgets}
  layouts={dashboardLayouts}
  onChange={(event) => {
    if (event.action === 'select') {
      // Raw selection (no layout processing)
      handleRawSelection(event.items)
    } else {
      // Add or delete (with layout processing)
      setWidgets(event.widgets!)
      setLayouts(event.layouts!)
    }
    return true
  }}
  config={{ mode: 'multi' }}
/>

Properties

Name
Type
Mandatory
Default Value
Example Value

show

boolean

Yes

-

-

onClose

() => void

Yes

-

-

widgets

Yes

-

-

layouts

Yes

-

-

onChange

(event: WidgetDrawerChangeEvent) => boolean | Promise

Yes

-

-

isBounded

boolean

No

-

-

maxColumns

number

No

-

-

Last updated