块编辑器开发文档

ToggleGroupControlOptionBase

💡 云策文档标注

概述

ToggleGroupControlOptionBase 是一个实验性的表单组件,用作 ToggleGroupControl 子组件的内部通用基础组件。它支持通过 props 配置子元素、值和工具提示显示。

关键要点

  • 这是一个实验性组件,可能发生重大变更,使用时需谨慎。
  • 作为 ToggleGroupControl 的内部组件,用于构建其子选项。
  • 主要 props 包括:children(必需,ReactNode 类型)、value(必需,字符串或数字类型)、showTooltip(可选,布尔类型,需配合 aria-label 使用)。

📄 原文内容
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.

ToggleGroupControlOptionBase is a form component and is meant to be used as an internal, generic component for any children of ToggleGroupControl.

Props

children: ReactNode

The children elements.

  • Required: Yes

value: string | number

The value of the ToggleGroupControlOptionBase.

  • Required: Yes

showTooltip: boolean

Whether to show a tooltip when hovering over the option. The tooltip will only show if a label for it is provided using the aria-label prop.

  • Required: No