# 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

```tsx
import { useWidgets } from 'uxp/components';
```

## Signature

```tsx
function useWidgets(options?: UseWidgetCacheOptions): UseWidgetsReturn
```

## Examples

```tsx
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()
```

## Related Types

* [UseWidgetCacheOptions](https://help.iviva.com/uxp/v5/additional-resources/types/usewidgetcacheoptions)
* [UseWidgetsReturn](https://help.iviva.com/uxp/v5/additional-resources/types/usewidgetsreturn)
* [IWidget](https://help.iviva.com/uxp/v5/additional-resources/types/iwidget)
* [IWidgetConfigs](https://help.iviva.com/uxp/v5/additional-resources/types/iwidgetconfigs)
* [DynamicFormFieldProps](https://help.iviva.com/uxp/v5/additional-resources/types/dynamicformfieldprops)
* [FormValue](https://help.iviva.com/uxp/v5/additional-resources/types/formvalue)
* [IFormData](https://help.iviva.com/uxp/v5/additional-resources/types/iformdata)
* [CustomValidateResponse](https://help.iviva.com/uxp/v5/additional-resources/types/customvalidateresponse)
* [FormSectionProps](https://help.iviva.com/uxp/v5/additional-resources/types/formsectionprops)
* [IConfigPanelProps](https://help.iviva.com/uxp/v5/additional-resources/types/iconfigpanelprops)
* [IContextProvider](https://help.iviva.com/uxp/v5/additional-resources/types/icontextprovider)
* [IPartialContextProvider](https://help.iviva.com/uxp/v5/additional-resources/types/ipartialcontextprovider)
* [Language](https://help.iviva.com/uxp/v5/additional-resources/types/language)
* [ICustomThemes](https://help.iviva.com/uxp/v5/additional-resources/types/icustomthemes)
* [IThemeProps](https://help.iviva.com/uxp/v5/additional-resources/types/ithemeprops)
* [ThemeType](https://help.iviva.com/uxp/v5/additional-resources/types/themetype)
* [UserDetails](https://help.iviva.com/uxp/v5/additional-resources/types/userdetails)
* [NavigationLink](https://help.iviva.com/uxp/v5/additional-resources/types/navigationlink)
* [Routes](https://help.iviva.com/uxp/v5/additional-resources/types/routes)
* [ConfiguredPage](https://help.iviva.com/uxp/v5/additional-resources/types/configuredpage)
* [ComponentType](https://help.iviva.com/uxp/v5/additional-resources/types/componenttype)
* [IUXPFunctions](https://help.iviva.com/uxp/v5/additional-resources/types/iuxpfunctions)
* [ViewOverride](https://help.iviva.com/uxp/v5/additional-resources/types/viewoverride)
* [Environment](https://help.iviva.com/uxp/v5/additional-resources/types/environment)
* [ExecutionOptions](https://help.iviva.com/uxp/v5/additional-resources/types/executionoptions)
* [CachingOptions](https://help.iviva.com/uxp/v5/additional-resources/types/cachingoptions)
* [IDataFunction](https://help.iviva.com/uxp/v5/additional-resources/types/idatafunction)
* [QueryParams](https://help.iviva.com/uxp/v5/additional-resources/types/queryparams)
* [ExecutionResult](https://help.iviva.com/uxp/v5/additional-resources/types/executionresult)
* [ExecuteMicroserviceConfig](https://help.iviva.com/uxp/v5/additional-resources/types/executemicroserviceconfig)
* [ExecuteConfigBase](https://help.iviva.com/uxp/v5/additional-resources/types/executeconfigbase)
* [LucyQueryResult](https://help.iviva.com/uxp/v5/additional-resources/types/lucyqueryresult)
* [IWidgetPreloader](https://help.iviva.com/uxp/v5/additional-resources/types/iwidgetpreloader)
* [IRenderUIItemProps](https://help.iviva.com/uxp/v5/additional-resources/types/irenderuiitemprops)
