ReviewBlock

Pill-shaped star rating block with decimal star fills and optional review count text.

Quick Preview

Sizes

Use size for the Figma-defined xs, sm, md, and lg review block variants.

Usage

import { ReviewBlock } from "@giddaa-housing/ui/review-block";

<ReviewBlock rating={4.6} reviewCount={23} />;

Props

Prop/APITypeDefaultDescription
ratingnumberrequiredRating value clamped to the 0-5 range. Decimal values render partial star fills.
size"xs" | "sm" | "md" | "lg""md"Controls the Figma-defined star, text, gap, and padding scale.
reviewCountnumber-Optional count rendered below the stars when review text is enabled.
reviewLabelstring"Review"Singular label used for review text. Plural appends s.
showReviewTextbooleantrueShows the review count below the stars when reviewCount is provided.
borderedbooleantrueAdds the brand-tinted pill border.
ratingLabelstringgeneratedOverrides the accessible label.
renderBase UI render prop-Changes the rendered element while preserving styles.
classNamestring-Local layout or spacing overrides.
native/root propsReact component props-Passed through to the underlying root element.

Accessibility

  • The root renders with role="img" and a generated label like 4.6 out of 5 stars, 23 Reviews.
  • Override ratingLabel when nearby copy already describes the review source or when the count needs custom wording.

On this page