diff --git a/docs/src/pages/components/Popover.svx b/docs/src/pages/components/Popover.svx index 03f1da78..d756b572 100644 --- a/docs/src/pages/components/Popover.svx +++ b/docs/src/pages/components/Popover.svx @@ -36,6 +36,12 @@ Set `closeOnOutsideClick` to set `open` to `false` when clicking outside of the +## Manage open state with a Button + +You can bind the `open` prop and manage the open state of the popover with an external button. + + + ## 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"`. diff --git a/docs/src/pages/framed/Popover/WithButton.svelte b/docs/src/pages/framed/Popover/WithButton.svelte new file mode 100644 index 00000000..fd3b6951 --- /dev/null +++ b/docs/src/pages/framed/Popover/WithButton.svelte @@ -0,0 +1,37 @@ + + +
+
+ + +
Content
+
+
+
+
+ Anim eu laboris veniam in est elit ullamco enim irure id. Lorem est culpa ex + in enim enim. Culpa quis incididunt magna officia et aliqua. Ullamco deserunt + aute enim cupidatat. Culpa quis enim sint sint anim qui irure exercitation labore + occaecat in reprehenderit proident. Nisi laborum ut et amet commodo amet ullamco + commodo non aliqua magna ad eu. Ad aliquip minim nostrud id enim elit velit ullamco + pariatur eu excepteur pariatur cillum. +
+
diff --git a/src/Popover/Popover.svelte b/src/Popover/Popover.svelte index 2287a72d..c26bc525 100644 --- a/src/Popover/Popover.svelte +++ b/src/Popover/Popover.svelte @@ -33,8 +33,8 @@ }, + { ["click:outside"]: CustomEvent<{ target: HTMLElement }> }, { default: {} } > {}