label-usage

Label UI form fields with a reusable Label component using htmlFor.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Form controls often lack accessible, consistently labeled inputs. This Skill provides a reusable Label component from the UI kit to ensure proper association via htmlFor, consistent sizing, and an easy path to indicate required fields without manual styling.

Core Features & Use Cases

  • Standalone labels for single controls and small form sections.
  • Enforces htmlFor association with inputs to improve accessibility.
  • Aligns label sizing with the field and supports required indicators through props.
  • Encourages consistent labeling practices and reduces custom markup.

Quick Start

Import the Label component and render it with an associated input using htmlFor.

Frequently Asked Questions about label-usage

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

FAQPage Schema
How do I bind a UI Kit label to a React input using htmlFor?

To bind a UI Kit label to a React input, use the Label component and set its htmlFor prop to match the input's id, enforcing proper accessible association without manual formatting.

What is the best way to indicate required fields in a React form without custom markup?

Indicating required fields in a React form without custom markup is done by passing the required prop to the Label component, which handles consistent visual indicators automatically.

Can I use the Label component for standalone sections outside of integrated form fields?

Yes, the Label component works for standalone scenarios like single controls and small form sections, providing consistent sizing and accessible binding via htmlFor outside integrated field contexts.

Does the Label component support disabled states and different sizes in React?

The Label component supports disabled states and different sizes in React through dedicated props, aligning label dimensions with field inputs and ensuring consistent rendering across forms.

Why should I use a UI Kit Label instead of manually formatting HTML labels in React?

Using a UI Kit Label instead of manually formatting HTML labels ensures proper htmlFor association, enforces accessible practices, and reduces custom markup overhead for consistent field rendering.