openmrs-esm-core

O3 Framework / ExtensionSlot

Function: ExtensionSlot()

ExtensionSlot(__namedParameters): Element

Defined in: packages/framework/esm-react-utils/src/ExtensionSlot.tsx:71

An extension slot. A place with a name. Extensions that get connected to that name will be rendered into this.

Parameters

__namedParameters

ExtensionSlotProps

Returns

Element

Examples

Passing a react node as children

<ExtensionSlot name="Foo">
  <div style=>
    <Extension />
  </div>
</ExtensionSlot>

Passing a function as children

<ExtensionSlot name="Bar">
  {(extension) => (
    <h1>{extension.name}</h1>
    <div style=>
      <Extension />
    </div>
  )}
</ExtensionSlot>