Skip to content

Commit b4a13c7

Browse files
committed
add Rating example
1 parent 025312b commit b4a13c7

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfRating } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col">
7+
<SfRating class="!text-red-600" value={4} />
8+
<SfRating class="!text-purple-500" value={4} />
9+
<SfRating class="!text-cyan-700" value={4} />
10+
</div>
11+
);
12+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfRating } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col">
7+
<SfRating value={4} size="xs" />
8+
<SfRating value={4} size="sm" />
9+
<SfRating value={4} size="base" />
10+
<SfRating value={4} />
11+
<SfRating value={4} size="lg" />
12+
<SfRating value={4} size="xl" />
13+
</div>
14+
);
15+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfRating } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col">
7+
<SfRating value={0} />
8+
<SfRating value={3.5} />
9+
<SfRating value={3.5} half-increment />
10+
<SfRating value={6} max={8} />
11+
</div>
12+
);
13+
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { SfIconStarFilled } from 'qwik-storefront-ui';
3+
4+
export default component$(() => {
5+
const value = 4.5;
6+
return (
7+
<div class="flex flex-col gap-2">
8+
<div class="font-medium typography-text-xs">
9+
<SfIconStarFilled class="text-warning-500 w-[1.5em] h-[1.5em]" />
10+
{value}
11+
</div>
12+
<div class="font-medium typography-text-sm">
13+
<SfIconStarFilled class="text-warning-500 w-[1.5em] h-[1.5em]" />
14+
{value}
15+
</div>
16+
<div class="font-medium">
17+
<SfIconStarFilled class="text-warning-500 w-[1.5em] h-[1.5em]" />
18+
{value}
19+
</div>
20+
<div class="font-medium typography-text-lg">
21+
<SfIconStarFilled class="text-warning-500 w-[1.5em] h-[1.5em]" />
22+
{value}
23+
</div>
24+
</div>
25+
);
26+
});

0 commit comments

Comments
 (0)