rating-usage

Integrate accessible @techsio/ui-kit Rating components with ZagJS wrapper.

2|Updated Dec 2, 2024
One-click install
npx skills add https://github.com/TechsioCZ/new-engine --skill rating-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rating-usage
Source: https://github.com/TechsioCZ/new-engine/tree/main/libs/ui/skills/rating-usage
Command: npx skills add https://github.com/TechsioCZ/new-engine --skill rating-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable developers to add accessible rating controls to their apps using the @techsio/ui-kit Rating component, ensuring consistent behavior and UX.

Core Features & Use Cases

  • Controlled and uncontrolled rating functionality with value/defaultValue, onChange, and hover handling.
  • Support for count, allowHalf, readOnly, and disabled states, plus labelText for accessibility.
  • Works with the ZagJS rating-group wrapper to unify interaction patterns across forms, product pages, and reviews.

Quick Start

Use Rating to capture a product rating in your UI by rendering a 5-star control.

Frequently Asked Questions about rating-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement an accessible rating component in React?

You can build an accessible rating component in React using the @techsio/ui-kit Rating, which leverages the ZagJS rating-group wrapper to unify interaction patterns and ensure proper accessibility across forms and product pages.

Can I display a read-only rating without user interaction?

Yes, you can display a read-only rating by setting the readOnly prop on the Rating component, which renders the value without allowing user interaction. The disabled prop also restricts input while maintaining visual accessibility.

How do I handle controlled and uncontrolled rating values?

Handle controlled rating values using the value and onChange props, or manage uncontrolled state with the defaultValue prop. The component also tracks hover interactions to support dynamic visual feedback.

Does the Rating component support half-star precision?

Yes, the Rating component supports half-star precision by enabling the allowHalf prop. You can also customize the total number of rating icons using the count prop.

What's the best way to style a rating control with custom design tokens?

The best way to style a rating control is by applying token-driven styling to the Rating component. This ensures consistent visual design across product pages and reviews while maintaining accessibility standards.

How do I add accessible labels and translations to a rating group?

Add accessible labels and translations to a rating group by configuring the labelText and translations props on the Rating component. You can also set the name prop for proper form submission integration.