Skip to content

Commit 55d7ceb

Browse files
committed
docs: rating
1 parent c898aff commit 55d7ceb

File tree

1 file changed

+16
-51
lines changed

1 file changed

+16
-51
lines changed

apps/docs/content/_components/rating.md

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ If you need to support partial stars, you can show half-filled star icons by pas
1616

1717
<Showcase showcase-name="Rating/RatingValues">
1818

19-
::vue-only
20-
<<<../../../preview/nuxt/pages/showcases/Rating/RatingValues.vue
21-
::
22-
::react-only
23-
<<<../../../preview/next/pages/showcases/Rating/RatingValues.tsx
24-
::
25-
::qwik-only
2619
<<<../../../website/src/routes/showcases/Rating/RatingValues/index.tsx
27-
::
2820

2921
</Showcase>
3022

@@ -34,33 +26,21 @@ If you need to support partial stars, you can show half-filled star icons by pas
3426

3527
<Showcase showcase-name="Rating/RatingSizes" style="min-height:250px">
3628

37-
::vue-only
38-
<<<../../../preview/nuxt/pages/showcases/Rating/RatingSizes.vue
39-
::
40-
::react-only
41-
<<<../../../preview/next/pages/showcases/Rating/RatingSizes.tsx
42-
::
43-
::qwik-only
4429
<<<../../../website/src/routes/showcases/Rating/RatingSizes/index.tsx
45-
::
4630

4731
</Showcase>
4832

4933
### Colors
5034

51-
Rating by default uses a `warning-500` for filled and partially filled stars and `disabled-500` as an empty icon color. You can change these values in your [Tailwind configuration](https://tailwindcss.com/docs/configuration#theme) or override them for a single element using [`important modifier`](https://tailwindcss.com/docs/configuration#important-modifier).
35+
Rating by default uses a `warning-500` for filled and partially filled stars and `disabled-500` as an empty icon color.
36+
37+
<!--
38+
You can change these values in your [Tailwind configuration](https://tailwindcss.com/docs/configuration#theme) or override them for a single element using [`important modifier`](https://tailwindcss.com/docs/configuration#important-modifier).
39+
-->
5240

5341
<Showcase showcase-name="Rating/RatingColors">
5442

55-
::vue-only
56-
<<<../../../preview/nuxt/pages/showcases/Rating/RatingColors.vue
57-
::
58-
::react-only
59-
<<<../../../preview/next/pages/showcases/Rating/RatingColors.tsx
60-
::
61-
::qwik-only
6243
<<<../../../website/src/routes/showcases/Rating/RatingColors/index.tsx
63-
::
6444

6545
</Showcase>
6646

@@ -70,44 +50,29 @@ For a more minimal look, you can also present ratings a single star icon with a
7050

7151
<Showcase showcase-name="Rating/SingleStar" style="min-height:220px">
7252

73-
::vue-only
74-
<<<../../../preview/nuxt/pages/showcases/Rating/SingleStar.vue
75-
::
76-
::react-only
77-
<<<../../../preview/next/pages/showcases/Rating/SingleStar.tsx
78-
::
79-
::qwik-only
8053
<<<../../../website/src/routes/showcases/Rating/SingleStar/index.tsx
81-
::
8254

8355
</Showcase>
8456

57+
<!--
8558
## Accessibility notes
8659
8760
For better out-of-the-box accessibility, `SfRating` adds `role="img"` and an `aria-label` property with value `Rating: [Avg value] out of [Max value] stars` where the values are replaced with the actual values. This can be overridden by passing an `aria-label` property to the component.
61+
-->
8862

8963
## Playground
9064

91-
<Generate style="height:400px" />
65+
<Generate class="playground" />
9266

9367
#tab-2
9468

9569
## Props
9670

97-
| Prop name | Type | Default value | Possible values |
98-
| --------------- | -------------- | ------------- | ------------------------------------ |
99-
| `size` | `SfRatingSize` | `'base'` | `'xs'`,`'sm'`,`'base'`,`'lg'`,`'xl'` |
100-
| `value` | `number` | `0` | |
101-
| `max` | `number` | `5` | |
102-
| `halfIncrement` | `boolean` | `false` | |
103-
104-
#tab-3
105-
106-
::vue-only
107-
<<<../../../../packages/sfui/frameworks/vue/components/SfRating/SfRating.vue
108-
::
109-
::react-only
110-
<<<../../../../packages/sfui/frameworks/react/components/SfRating/SfRating.tsx
111-
::
112-
113-
::
71+
| Prop name | Type | Default value | Possible values |
72+
| ---------------- | -------------- | ------------- | ------------------------------------ |
73+
| `class?` | `string` | | |
74+
| `value?` | `number` | `0` | |
75+
| `max?` | `number` | `5` | |
76+
| `size?` | `SfRatingSize` | `'base'` | `'xs'`,`'sm'`,`'base'`,`'lg'`,`'xl'` |
77+
| `halfIncrement?` | `boolean` | `false` | |
78+
| `ariaLabel?` | `string` | | |

0 commit comments

Comments
 (0)