Rate this page:
The IssuePanelAction
component defines an item in the more actions ••• menu of an issue panel.
You can view existing issue panel actions via the more actions ••• menu.
You must provide the IssuePanelAction
component as an argument to the actions
property of the IssuePanel component.
1
import ForgeUI, { IssuePanelAction } from '@forge/ui';
Name | Type | Required | Description |
---|---|---|---|
text | string | Yes | The name of the item that’s added to the actions menu of an issue panel. |
onClick | () => void|Promise<void> | Yes | An event handler executed when the item is clicked. You can perform state updates inside this function. |
A hello world example of an IssuePanel
component with a custom action.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import ForgeUI, {IssuePanel, IssuePanelAction, render, Text, useProductContext, useState} from '@forge/ui';
const App = () => {
const [waveCount, setWaveCount] = useState(0);
return (
<IssuePanel actions={[
<IssuePanelAction text="Custom action" onClick={() => {
setWaveCount(waveCount + 1);
}}/>
]}>
<Text>Hello, world! {"👋".repeat(waveCount)}</Text>
</IssuePanel>
);
};
export const run = render(
<App/>
);
Rate this page: