Inject

Renders components next to the children, before or after them.

Usage

Use Inject for elements a layout always keeps alongside its children, like a background or custom cursor. It renders them as siblings, so the children aren't wrapped.

tsx
<Inject components={[Background, Cursor]} onTop>
  <Page />
</Inject>
Background
Cursor
Page

Reference

proptypedefault
components?Renderable[][]rendered as siblings of the children
onTop?booleanfalserender them before the children instead of after
children?ReactNode—the children, rendered as they are