Rate this page:
The DashboardGadget
component is returned from a function
defined in the app manifest to render content for a
dashboard gadget.
This component can be used in Jira Core, Jira Software, and Jira Service Desk to render the gadget in the Dashboards page.
You can also use the DashboardGadgetEdit component to extend the gadget to save a configuration.
1 2import ForgeUI, { DashboardGadget } from "@forge/ui";
Name | Type | Required | Description |
---|---|---|---|
children | Array | Yes | The view code for the dashboard gadget. Can contain any UI Kit component. |
An example of a dashboard gadget component that displays a hello message. The user can input a name in the edit mode of this app that is used in the message; otherwise, the message says "Hello world."
1 2import ForgeUI, { render, DashboardGadget, Text, useProductContext, } from "@forge/ui"; const App = () => { const { extensionContext: { gadgetConfiguration }, } = useProductContext(); return ( <DashboardGadget> <Text content={`Hello ${gadgetConfiguration.name || "world"}`} /> </DashboardGadget> ); }; export const run = render(<App />);
This is the dashboard gadget view created by the example code.
See DashboardGadgetEdit for an example of an editable gadget.
Rate this page: