docs(popover): simplify external element example

This commit is contained in:
Eric Liu 2022-12-07 20:13:13 -08:00
commit a3204cc131
2 changed files with 19 additions and 36 deletions

View file

@ -36,12 +36,6 @@ Set `closeOnOutsideClick` to set `open` to `false` when clicking outside of the
</Popover>
</div>
## Manage open state with a Button
You can bind the `open` prop and manage the open state of the popover with an external button.
<FileSource src="/framed/Popover/WithButton" />
## Popover alignment
Customize the popover alignment using the `align` prop. Valid values include: `"top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "left-bottom" | "left-top" | "right" | "right-bottom" | "right-top"`.
@ -153,4 +147,10 @@ Possible `align` values include `"top"`, `"top-left"`, `"top-right"`, `"bottom"`
<Popover highContrast open>
<div style="padding: var(--cds-spacing-05)">Content</div>
</Popover>
</div>
</div>
## External element
Use the `open` prop to manage state with an external element, like a button.
<FileSource src="/framed/Popover/WithButton" />