cpn-basic-tabs

Configure UDesign Tabs components with unique keys for every Pane.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/UCloud-FE/udesign-cli --skill cpn-basic-tabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpn-basic-tabs
Source: https://github.com/UCloud-FE/udesign-cli/tree/main/skills/cpn-basic-tabs
Command: npx skills add https://github.com/UCloud-FE/udesign-cli --skill cpn-basic-tabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

在使用 UDesign Tabs 组件时,必须为每个 Pane 提供唯一的 key,否则 Tabs 可能无法正确切换或渲染。

Core Features & Use Cases

  • Pane 必须有唯一 key:这是 Tabs 正常工作的前提
  • 键盘切换:支持键盘导航切换标签
  • 滚动与布局:当 Pane 数量较多时自动出现滚动条,确保可访问性与可用性
  • 基本用法示例:展示如何在 Tabs 中添加 Pane 并设置 key

Quick Start

给出一个 Tabs 的使用示例,确保每个 Pane 都带有唯一的 key,并遵循 UDesign 的使用约定。

Frequently Asked Questions about cpn-basic-tabs

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

FAQPage Schema
Why do React Tabs panes need unique keys to switch correctly?

React Tabs panes require unique keys to prevent rendering and switching failures. Without distinct keys, the component cannot track which pane is active, leading to incorrect content display and broken keyboard navigation.

How do I configure UDesign Tabs panes with unique keys in React?

To configure UDesign Tabs, assign a distinct key prop to every Tabs.Pane child. Following this pattern ensures proper tabbed interface rendering, enables keyboard navigation, and maintains responsive layout scrolling.

Does the Tabs component support keyboard navigation and responsive scrolling?

Yes, the Tabs component supports keyboard navigation for switching and responsive layouts. When pane quantities exceed the viewport width, scrollbars automatically appear to maintain accessible ergonomics and usability.

What happens if I have duplicate keys in my React Tabs panes?

Duplicate keys in React Tabs panes cause incorrect switching and rendering failures. Enforcing unique keys for every pane is the fundamental prerequisite to ensure the tabbed interface functions dynamically and accessibly.

What is the best way to handle dynamic content in React tabbed interfaces?

The best way to handle dynamic content in React tabbed interfaces is enforcing unique keys for each Tabs.Pane. This prevents duplicate key conflicts and ensures accessible ergonomics during keyboard navigation and responsive layout adjustments.