Forge Developer

Beta

Forge Developer

Beta

Rate this page:

Macro

A Macro component renders an area of dynamic content in a Confluence page or blog. The Macro component is used for the macro module. You can also let users configure the macro by following the instructions in Add configuration to a macro.

Usage

1
import ForgeUI, { Macro } from '@forge/ui';

Props

NameTypeRequiredDescription
appForgeExtensionYesThe app code for the macro.

Example

An app that displays the name and age of a pet in a macro.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import ForgeUI, { render, Macro, Text } from "@forge/ui";

const App = () => {
  const data = {
    name: "Fluffy",
    age: 2
  }

  return <Text>{data.name} is {data.age} years old.</Text>;;
};

export const run = render(
  <Macro
    app={<App />}
  />
);

Preview

Example of macro with the above sample code

Rate this page: