Last updated Nov 4, 2020

Fragment

Returns a list of components. Similar to React’s Fragment.

Screenshot of rendered Fragment example

Usage notes

Because a function can only return one top-level component, this component is used for wrapping a list of top-level components.

Import statement

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

Props

NameTypeRequiredDescription
childrenArray<ForgeComponent>YesA container for displaying multiple components. Can contain any UI kit component.

Example

1
2
const App = () => (
  <Fragment>
    <Text>Hello world!</Text>
    <Button text="Do something" onClick={onClick} />
  </Fragment>
);

Rate this page: