This is an example of customizing a custom widget (CustomOne) in a React application that is built using Vite.
fixture/test-widgets/Custom.ts
)CustomOne
) that extends a base widget class (CustomBase
).id
, name
, description
, and department
(e.g., "test"
)icon
(using a Lucide icon name, "activity"
)size
(height and width in grid units)backgroundCSS
(a light gray color).tsx
file) and production (a compiled .es.js
file).routePrefix
(likely a base URL for asset loading).modules/test/ComponentB.tsx
)useState
)modules/test/vite.config.module.ts
)lib
mode).ComponentB.es.js
.react
and react-dom
as external dependencies (they won’t be bundled; expected to be loaded separately).@
points to a shared JS directory)..tsx
usage) and production (optimized .es.js
file).CustomOne
defines the widget’s metadata and where its JavaScript lives.ComponentB
provides the interactive UI (a counter button with a message).ComponentB.es.js
).
.tsx
file directly..es.js
file from a CDN-like path (/assets/modules/
).This setup allows the widget to be reusable, dynamically loaded, and integrated into a larger application.