useWidgets

Public API hook for accessing widgets and UIs throughout the application

Use this hook when you need to:

  • Get list of all widgets or UIs

  • Look up a widget/UI by ID (e.g., for configuration forms)

  • Reload widget/UI data

For widget drawer specific features (filtering, pagination, etc.) use useDrawerItems instead

Installation

import { useWidgets } from 'uxp/components';

Signature

function useWidgets(options?: UseWidgetCacheOptions): UseWidgetsReturn

Examples

typescript
const { widgets, findWidgetById, reload, isLoading } = useWidgets()

// Get all widgets
const allWidgets = widgets

// Find specific widget
const myWidget = findWidgetById('my-widget-id')

// Reload data
await reload()

Last updated