Skip to content

Commit

Permalink
Docs: Remove outdated info (#54707)
Browse files Browse the repository at this point in the history
* Update components docs

* Remove outdated popover info
  • Loading branch information
brookewp committed Sep 26, 2023
1 parent 9a34f30 commit be69ef4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ Many components include CSS to add styles, which you will need to load in order

In non-WordPress projects, link to the `build-style/style.css` file directly, it is located at `node_modules/@wordpress/components/build-style/style.css`.

### Popovers and Tooltips

_If you're using [`Popover`](/packages/components/src/popover/README.md) or [`Tooltip`](/packages/components/src/tooltip/README.md) components outside of the editor, make sure they are rendered within a `SlotFillProvider` and with a `Popover.Slot` somewhere up the element tree._
### Popovers

By default, the `Popover` component will render within an extra element appended to the body of the document.

If you want to precisely contol where the popovers render, you will need to use the `Popover.Slot` component.

A `Popover` is also used as the underlying mechanism to display `Tooltip` components.
So the same considerations should be applied to them.

The following example illustrates how you can wrap a component using a
`Popover` and have those popovers render to a single location in the DOM.

Expand All @@ -58,7 +53,7 @@ const Example = () => {
<SlotFillProvider>
<MyComponentWithPopover />
<Popover.Slot />
</SlotFillProvider>
</SlotFillProvider>;
};
```

Expand Down

0 comments on commit be69ef4

Please sign in to comment.