Skip to content

Commit 6ce57f5

Browse files
committed
DOCS: added doc examples
1 parent a1f1392 commit 6ce57f5

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

apps/website/src/routes/docs/headless/checkbox/examples/hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default component$(() => {
77
<CheckboxIndicator class="flex h-[25px] w-[25px] items-center justify-center bg-slate-600">
88
99
</CheckboxIndicator>
10-
Accept item
10+
I have read the README file
1111
</MyCheckbox>
1212
</>
1313
);

apps/website/src/routes/docs/headless/checkbox/examples/pizza.tsx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
11
import { component$, useSignal, useStyles$ } from '@builder.io/qwik';
2-
import { MyCheckbox, CheckboxIndicator, CheckList } from '@qwik-ui/headless';
2+
import {
3+
MyCheckbox,
4+
CheckboxIndicator,
5+
CheckList,
6+
ChecklistIndicator,
7+
Checkbox,
8+
} from '@qwik-ui/headless';
9+
const toppingNames = ['hot peppers', 'ham', 'pineaple', 'mushroom'];
10+
const toppingImages = ['🌶️', '🍗', '🍍', '🍄'];
311
export default component$(() => {
412
return (
513
<>
614
<h3 id="pizza-toppings">Pizza toppings</h3>
7-
<CheckList ariaLabeledBy="pizza-toppings">
15+
<CheckList ariaLabeledBy="pizza-toppings" class="flex flex-col gap-4">
816
<MyCheckbox
9-
class="flex items-center gap-3 border-2 border-black p-2 "
17+
class="flex items-center gap-3 border-2 border-black p-2"
1018
checkList={true}
1119
>
12-
<CheckboxIndicator class="flex h-[25px] w-[25px] items-center justify-center bg-slate-600">
13-
14-
</CheckboxIndicator>
20+
<ChecklistIndicator class="w-fit bg-black">
21+
<div q:slot="checkbox" id="true-img">
22+
🍕
23+
</div>
24+
25+
<div q:slot="checklist" id="mixed-img">
26+
27+
</div>
28+
</ChecklistIndicator>
1529
Pick all toppings
1630
</MyCheckbox>
31+
32+
{toppingNames.map((name, i) => {
33+
return (
34+
<MyCheckbox class="ml-8 flex items-center gap-3 border-2 border-black p-2">
35+
<CheckboxIndicator class="flex h-[25px] w-[25px] items-center justify-center bg-slate-600">
36+
{toppingImages[i]}
37+
</CheckboxIndicator>
38+
{name}
39+
</MyCheckbox>
40+
);
41+
})}
1742
</CheckList>
1843
</>
1944
);

apps/website/src/routes/docs/headless/checkbox/examples/test-default.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default component$(() => {
66
return (
77
<>
88
<p>I'm the default checkbox!!!</p>
9-
<MyCheckbox class="bg-slate-900 text-white">
9+
<MyCheckbox class=" text-white">
1010
<div class="flex items-center gap-3">
1111
<CheckboxIndicator class="w-fit bg-slate-600">
1212
<p id="indicator"></p>

0 commit comments

Comments
 (0)