复选框的切换开关替代方案。
¥API Reference
¥This component inherits props from the Switch primitive and supports common margin props.
¥Examples
¥Size
使用 size
属性控制开关的大小。
¥Use the size
prop to control the size of the switch.
¥Variant
使用 variant
属性控制开关的视觉样式。
¥Use the variant
prop to control the visual style of the switch.
¥Color
使用 color
属性指定特定的 color。
¥Use the color
prop to assign a specific color.
¥High-contrast
使用 highContrast
属性增加亮色模式下的色彩对比度。
¥Use the highContrast
prop to increase color contrast in light mode.
¥Radius
使用 radius
属性指定特定的圆角值。
¥Use the radius
prop to assign a specific radius value.
¥Alignment
在 Text
中组合 Switch
,会自动将其与第一行文本居中。
¥Composing Switch
within Text
automatically centers it with the first line of text.
它还能自动与多行文本对齐。
¥It is automatically well-aligned with multi-line text too.
¥Disabled
使用原生 disabled
属性创建禁用的开关。
¥Use the native disabled
attribute to create a disabled switch.