Floating Badge
A compact rating badge, inline or pinned to a corner of the screen.
The 5zero Floating Badge is a small card with stars, the rating and the review count, like ★★★★★ 4.8 out of 5 · 2,341 reviews, with an optional logo. Place it inline, or pin it to a corner of the screen, where it stays visible while shoppers scroll.
Where to place it
- Fixed to a corner of the screen
- Inline in any section
Adding it to your theme
- In the Theme Editor, open the template, or the footer if it should appear on every page.
- Click Add block and choose 5zero Floating Badge from the Apps tab.
- Choose a Position: Inline, or fixed to a corner.
Settings
| Setting | What it does |
|---|---|
| Review scope | This product, All product reviews, Store reviews (about the shop itself) or All reviews. This product shows all reviews outside product pages. |
| Show from (reviews), Show up to (reviews) | Hide the badge outside this range. On product pages this counts the product's reviews, elsewhere the reviews in this block. |
| Structure | The text of the badge. Default: {stars}, <b>{rating}</b> out of 5, {count} {review|reviews} and {logo}, one per line. Placeholders: {logo}, {stars}, {star}, {rating}, {rating_decimal}, {max}, {count}, {count_compact}. See text templates for how they work. |
| Link, Open link in new tab | Where a click goes, for example a page with all your reviews. Empty shows no link. |
| Position | Inline shows it where the block sits. Bottom right, Bottom left, Top right and Top left keep it on screen while scrolling. |
| Show on | All devices, Desktop only or Mobile only. Mobile means screens narrower than the small screen breakpoint in the app's Display settings. |
| Background color | Empty is transparent. |
| Text color, Text size | Empty text color uses your theme's. Text size is relative to your theme's, 100% keeps it. |
| Star color, Star size | Empty star color uses the one from 5zero Core. Star size is relative to Core's, where the star icons are set too. |
| Logo | The image for {logo}, like a review platform logo. |
| Anchor ID | An ID links can jump to. |
| Custom CSS | Applies to this block only. See Customising blocks. |
Examples
A fixed badge keeps 1rem away from the screen edges. Change the distance with --fo-floating-badge-bleed: 1.5rem; in the block's Custom CSS.
The example below builds the badge into your own theme code. Each example brings the CSS for exactly the look of its preview, scoped to its own classes so it does not touch the rest of your theme. Only the font and the text color come from your theme. The stars (fo-stars) need 5zero's star styles on the page, which every 5zero block and the Card Rating app embed load.
A badge in your theme
The same badge as a link in your own footer or header, from the shop's metafields:
{%- assign fiveoh = shop.metafields['app--324569563137'] -%}
<a href="/pages/reviews" class="reviews-badge">
<span class="fo-stars" style="--fo-rating: {{ fiveoh.rating.value.rating }}"></span>
<span><strong>{{ fiveoh.rating.value.rating }}</strong> out of 5 · {{ fiveoh.rating_count_compact.value }} reviews</span>
</a>The texts are in English to keep the code short. Other languages
Troubleshooting
- The badge covers content or the chat button: pick another corner, or move it with
--fo-floating-badge-bleed. - No rating shows: check that there are reviews for the chosen Review scope. Store reviews only counts reviews about your shop.