Skip to content

Commit 44ebc29

Browse files
docs(popover): docs-improvements
1 parent 7978a8e commit 44ebc29

File tree

1 file changed

+43
-0
lines changed
  • apps/website/src/routes/docs/headless/popover

1 file changed

+43
-0
lines changed

apps/website/src/routes/docs/headless/popover/index.mdx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,49 @@ A non-modal primitive with overlays that open and close around a DOM element.
2727

2828
The Qwik UI Popover component is designed to align with the [HTML Popover API Specification](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API). As of now, native support for this API is around `72%`. To ensure consistent behavior across all browsers, Qwik UI provides a `polyfill` for browsers that do not support the API natively.
2929

30+
<div class="flex flex-col gap-2">
31+
<div>
32+
[View Source Code
33+
↗️](https://github.com/qwikifiers/qwik-ui/tree/main/packages/kit-headless/src/components/popover)
34+
</div>
35+
<div>[Report an issue 🚨](https://github.com/qwikifiers/qwik-ui/issues)</div>
36+
<div>
37+
[Edit This Page
38+
🗒️](https://github.com/qwikifiers/qwik-ui/blob/main/apps/website/src/routes/docs/headless/popover/index.mdx)
39+
</div>
40+
</div>
41+
42+
## Building blocks
43+
44+
```tsx
45+
import { component$, useStyles$ } from '@builder.io/qwik';
46+
import { Popover, PopoverTrigger } from '@qwik-ui/headless';
47+
48+
export default component$(() => {
49+
return (
50+
<>
51+
<PopoverTrigger popovertarget="building-blocks">Inside Trigger</PopoverTrigger>
52+
<Popover id="building-blocks">Inside Popover</Popover>
53+
</>
54+
);
55+
});
56+
```
57+
58+
### 🎨 Anatomy
59+
60+
<AnatomyTable
61+
propDescriptors={[
62+
{
63+
name: 'PopoverTrigger',
64+
description: 'An HTML Button component that opens the popover when clicked.',
65+
},
66+
{
67+
name: 'Popover',
68+
description: `An HTML Element that is above other content on the page.`,
69+
},
70+
]}
71+
/>
72+
3073
## What is a Popover?
3174

3275
A popover is a **non-modal** UI element that creates overlays around a DOM element. Non-modal meaning the rest of the page can be interacted with while the popover is shown.

0 commit comments

Comments
 (0)