Components

Rate this page:

This section describes a Forge preview feature. Preview features are deemed stable; however, they remain under active development and may be subject to shorter deprecation windows. Preview features are suitable for early adopters in production environments.

We release preview features so partners and developers can study, test, and integrate them prior to General Availability (GA). For more information, see Forge release phases: EAP, Preview, and GA.

User

To add the User component to your app:

1
2
import { User } from '@forge/react';

Description

A component that represents a user, displaying details such as name and profile picture, subject to the user's privacy settings. The User component can also be used within a Text component, appearing as a lozenge with the name of the user when used within this context.

Props

NameTypeRequiredDescription
accountIdstringYesThe Atlassian account ID of the user.

Examples

Display a user

1
2
<User accountId="5a1234bc8d12345e3f1g11hi" />
<User accountId="3a1264bc8d12346eky1g11ok" />

You can access the current user's Atlassian account ID in the app product context.

Output

Example image of rendered pictures and names of Atlassian users

Display as an inline user within a Text component

1
2
<Text>
  Contributors: <User accountId="5a1234bc8d12345e3f1g11hi" /> <User accountId="3a1264bc8d12346eky1g11ok" />
</Text>

Output

Example image of a rendered picture and name of an Atlassian user within a Text component

Rate this page: