color-select-usage

Render color swatches with configurable layout, size, and selection modes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Color selection is a frequent but error-prone task in UI when designers and developers must present color options clearly and consistently. This Skill provides a ready-to-use ColorSelect component workflow that renders color swatches, enforces layout, size, and radius options, and supports single or multiple selection modes to streamline color-based decisions.

Core Features & Use Cases

  • Layout and sizing controls: layout (list or grid), size (sm | md | lg | full), and radius (sm | md | lg | full) to match design systems.
  • Color-driven selections: colors array with color, label, and selected state to drive visual feedback.
  • Use Case: design a product filter with color swatches or a color-selection UI for product variants.

Quick Start

Create a ColorSelect with a colors array and bind an onColorClick callback to handle user color selection.

Frequently Asked Questions about color-select-usage

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

FAQPage Schema
How do I build a color swatch selector for a React UI kit?

To build a color swatch selector in React, pass a colors array containing color values and labels to a ColorSelect component, then bind an onColorClick callback to manage the selection state and trigger visual feedback.

Can I display color swatches in a grid layout for product variants?

Yes, you can display color swatches in a grid layout for product variants. The ColorSelect component supports layout options including list or grid, alongside size and radius controls, to streamline color-based decisions in product catalogs.

How does single or multiple selection mode work for color swatches?

Selection mode for color swatches works by using the selectionMode input to enforce either single or multiple selections. The component updates the selected state within the colors array to manage and reflect the user's current color choices.

What's the best way to manage selection state in UI color picker components?

The best way to manage selection state in UI color picker components is to define a colors array with built-in selected states and use an onColorClick callback. This approach handles visual feedback and enforces layout constraints consistently.

Do I need external dependencies to implement color selection in a design system?

No external dependencies are required to implement color selection in a design system. The Skill provides a self-contained ColorSelect workflow that handles layout, sizing, and selection modes independently within your UI components.