Skip to content

Commit 0792f5a

Browse files
committed
docs(popover-examples): simplify programmatic styles
1 parent 518f43d commit 0792f5a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

apps/website/src/routes/docs/headless/popover/examples/programmatic.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import { component$ } from '@builder.io/qwik';
22
import { Popover, usePopover } from '@qwik-ui/headless';
3-
3+
import { Button } from '@qwik-ui/styled';
44
export default component$(() => {
55
const { togglePopover } = usePopover(`programmatic-id`);
66
return (
77
<>
8-
<button
8+
<Button
99
preventdefault:click
10-
class="rounded-base border-2 border-slate-400 bg-slate-800 px-3 py-1 text-white"
1110
onKeyDown$={(e) => {
1211
if (e.key === 'o') {
1312
togglePopover();
1413
}
1514
}}
1615
>
1716
Focus me and press the 'o' key!
18-
</button>
19-
<Popover
20-
id="programmatic-id"
21-
class="rounded-base border-2 border-slate-300 bg-slate-800 px-3 py-1 opacity-0 shadow-md"
22-
>
17+
</Button>
18+
<Popover id="programmatic-id" class="popover">
2319
I was programmatically opened!
2420
</Popover>
2521
</>

0 commit comments

Comments
 (0)