Skip to content

feat(Switch): add shape api for web#914

Open
Seeridia wants to merge 1 commit into
TDesignOteam:mainfrom
Seeridia:feat/switch-shape
Open

feat(Switch): add shape api for web#914
Seeridia wants to merge 1 commit into
TDesignOteam:mainfrom
Seeridia:feat/switch-shape

Conversation

@Seeridia

@Seeridia Seeridia commented Jul 2, 2026

Copy link
Copy Markdown

犀牛鸟 Issue,关联 Issue: Tencent/tdesign-common/issues/2563

为 Switch 新增 shape API,用于支持三种形态:

  • circle: 默认胶囊形,保持当前视觉不变。
  • round: 圆角矩形形态。
  • line: 线性形态。

相关 PR:

  1. tdesign-api:feat(Switch): add shape api for web #914
  2. tdesign-common:style(Switch): support round and line shapes Tencent/tdesign-common#2604
  3. tdesign-vue-next:feat(Switch): support shape prop Tencent/tdesign-vue-next#6776
  4. tdesign-react:feat(Switch): support shape prop Tencent/tdesign-react#4320
  5. Tdsign-vue:feat(Switch): support shape prop Tencent/tdesign-vue#3855

设计稿:https://www.figma.com/design/r9jPY6A4EUDvEdoWQ1LVxe/TDesign-for-web--Community----Select?node-id=45757-378235&t=5X597ofKeSefwy0q-1

image

Copilot AI review requested due to automatic review settings July 2, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new shape API to the Switch component surface area for web frameworks in this repo (Vue, Vue Next, React), aligning type definitions, runtime prop definitions (where applicable), and generated API docs.

Changes:

  • Add shape?: 'circle' | 'round' | 'line' to Switch TS prop types (Vue/Vue Next/React).
  • Add shape to Vue/Vue Next Switch prop definitions with default circle and an options validator.
  • Document shape in Switch markdown tables (CN/EN), including the note that label is not rendered when shape="line".

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/products/tdesign-vue/src/switch/type.ts Adds shape to Vue Switch prop TS interface.
packages/products/tdesign-vue/src/switch/switch.md Documents shape in Vue CN API table.
packages/products/tdesign-vue/src/switch/switch.en-US.md Documents shape in Vue EN API table.
packages/products/tdesign-vue/src/switch/props.ts Adds Vue runtime prop definition for shape (default + validator).
packages/products/tdesign-vue-next/packages/components/switch/type.ts Adds shape to Vue Next Switch prop TS interface.
packages/products/tdesign-vue-next/packages/components/switch/switch.md Documents shape in Vue Next CN API table.
packages/products/tdesign-vue-next/packages/components/switch/switch.en-US.md Documents shape in Vue Next EN API table.
packages/products/tdesign-vue-next/packages/components/switch/props.ts Adds Vue Next runtime prop definition for shape (default + validator).
packages/products/tdesign-vue-next/examples/switch/switch.md Updates Vue Next examples API table to include shape.
packages/products/tdesign-vue-next/examples/switch/switch.en-US.md Updates Vue Next examples EN API table to include shape.
packages/products/tdesign-react/packages/components/switch/type.ts Adds shape to React Switch prop TS interface.
packages/products/tdesign-react/packages/components/switch/switch.md Documents shape in React CN API table.
packages/products/tdesign-react/packages/components/switch/switch.en-US.md Documents shape in React EN API table.
packages/products/tdesign-react/packages/components/switch/defaultProps.ts Adds shape: 'circle' to React Switch default props.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants