backdrop
组件

分隔线

在视觉或语义上分隔内容。
Reka UI
An open-source UI component library.
Blog
Docs
Source

功能特性

  • 支持水平和垂直两种方向

安装

通过命令行安装该组件。

sh
$ npm add reka-ui

结构

导入所有部件并组合在一起。

vue
<script setup>
import { Separator } from 'reka-ui'
</script>

<template>
  <Separator />
</template>

API 参考

根组件 (Root)

分隔线组件。

PropDefaultType
as
'div'
AsTag | Component

The element or component this component should render as. Can be overwritten by asChild.

asChild
boolean

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read our Composition guide for more details.

decorative
boolean

Whether or not the component is purely decorative.
When true, accessibility-related attributes are updated so that that the rendered element is removed from the accessibility tree.

orientation
'horizontal'
'vertical' | 'horizontal'

Orientation of the component.

Either vertical or horizontal. Defaults to horizontal.

Data AttributeValue
[data-orientation]"vertical" | "horizontal"

无障碍访问

遵循 separator 角色要求