Using Rating Component in Astro.js

Twinkle twinkle two point five.

Rating Component Position Examples

Inline Position (Default)

This is a paragraph with an ★★★★☆ inline rating that doesn’t disrupt the text flow. The text continues right after the rating without breaking to a new line.

Left Position

★★★⯨☆

3.5/5

This paragraph has a left-aligned rating. Notice how the text wraps around the rating rather than starting on a new line. This is useful for magazine-style layouts where you want the rating to stand out but still want text to flow naturally around it.

Right Position

★★★★★

5/5

This paragraph has a right-aligned rating. Similar to the left position, the text wraps around the rating. This position works well when you want to emphasize the rating at the end of a section or when you want to create a visual balance with other elements on the page.

Center Position

★★★★⯨

4.5/5

The center position takes up its own line and centers the rating. This is ideal for highlighting important ratings or when you want to create a clear visual separation between content sections.

Mixed Example

★★☆☆☆

2/5

This is an example of how you might use a left-aligned rating at the beginning of a paragraph to immediately convey your opinion before the reader dives into your detailed thoughts. The small size makes it less intrusive.

Meanwhile, this paragraph has ★★★★☆ 4/5 an inline rating in the middle of the text, which can be useful when you’re comparing multiple items within a single paragraph.

★★★★★

5/5

And finally, this paragraph shows how a right-aligned rating can serve as a visual conclusion to your thoughts, creating a nice bookend effect.

Read Next

Using LinkCard Components in Astro.js

This is a must.

从 Jekyll 到 Astro

修修补补又是一年
我的博客在 Github Pages 上运行了很多年, 直到我不再是学生以后, GitHub Education 过期, 我再也无法用 Private repo 创建页面, 于是开始寻找替代品. 今年年初我开始用 CloudFlare Pa...