Common UI kit components
Confluence UI kit components
Jira UI kit components
Jira Service Management UI kit components

Rate this page:

DashboardGadgetEdit

The DashboardGadgetEdit component is returned from a function defined in the edit property in the app manifest. When the component is returned, an edit mode is rendered for the dashboard gadget.

This component can be used in Jira Core, Jira Software, and Jira Service Desk to render an edit mode for a dashboard gadget in the Dashboards page.

In edit mode, dashboard gadgets use a mechanism built into Jira to update the stored gadget configuration.

Import statement

1
2
import ForgeUI, { DashboardGadgetEdit } from "@forge/ui";

Props

NameTypeRequiredDescription
childrenArrayYesThe edit code for the dashboard gadget. Can contain any UI Kit component.
onSubmit(formData: FormData) => PromiseYesAn event handler that can be asynchronous. The argument, formData, is an object made up of input field keys and their values (see the following example).

onSubmit

The onSubmit function must be provided for the gadget configuration to be saved. The values returned from onSubmit are the values that are saved as the gadget configuration.

Example

A simple example of a dashboard gadget edit component enabling the input of a name that is displayed in the app's view mode.

1
2
import ForgeUI, {
  render,
  DashboardGadgetEdit,
  TextField,
} from "@forge/ui";

const Edit = () => {
  const onSubmit = (values) => {
      return values;
  }

  return (
    <DashboardGadgetEdit onSubmit={onSubmit}>
      <TextField name="name" label="Say hello to:" />
    </DashboardGadgetEdit>
  );
};

export const runEdit = render(<Edit />);

Preview

This is the dashboard gadget edit mode created by the example code.

A dashboard gadget in edit mode.

Rate this page: