ListDividerAPI
React ListDivider 组件的 API 参考文档。了解此导出模块的属性、CSS 和其他 API。
演示
导入
import ListDivider from '@mui/joy/ListDivider';
// or
import { ListDivider } from '@mui/joy';通过阅读本指南,了解关于最小化 bundle size 的区别。
原生组件的属性也可用。
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| children | node | - | 组件的内容。 |
| component | elementType | - | 用于根节点的组件。可以是用于 HTML 元素的字符串或组件。 |
| inset | 'context' | 'gutter' | 'startDecorator' | 'startContent' | string | 'context' | 垂直列表中分隔线侧面的空白空间。 |
| orientation | 'horizontal' | 'vertical' | 'horizontal' | 组件的方向。 |
| slotProps | { root?: func | object } | {} | 用于每个内部插槽的属性。 |
| slots | { root?: elementType } | {} | 用于每个内部插槽的组件。 有关更多详细信息,请参阅下面的 Slots API。 |
| sx | Array<func | object | bool> | func | object | - | 允许定义系统覆盖以及其他 CSS 样式的系统属性。 有关更多详细信息,请参阅 `sx` 页面。 |
ref 被转发到根元素。主题默认属性
您可以使用 JoyListDivider 通过主题更改此组件的默认属性。
要了解如何自定义插槽,请查看 覆盖组件结构 指南。
| 插槽名称 | 类名 | 默认组件 | 描述 |
|---|---|---|---|
| root | .MuiListDivider-root | 'li' | 渲染根组件的组件。 |
这些类名对于使用 CSS 进行样式设置很有用。当触发特定状态时,它们会应用于组件的插槽。
| 类名 | 规则名称 | 描述 |
|---|---|---|
| .MuiListDivider-horizontal | horizontal | 如果 orientation="horizontal",则应用于根元素的类名。 |
| .MuiListDivider-insetGutter | insetGutter | 如果 inset="gutter",则应用于根元素的类名。 |
| .MuiListDivider-insetStartContent | insetStartContent | 如果 inset="startContent",则应用于根元素的类名。 |
| .MuiListDivider-insetStartDecorator | insetStartDecorator | 如果 inset="startDecorator",则应用于根元素的类名。 |
| .MuiListDivider-vertical | vertical | 如果 orientation="vertical",则应用于根元素的类名。 |
您可以使用以下自定义选项之一覆盖组件的样式
- 使用全局类名。
- 在自定义主题中,使用作为组件
styleOverrides属性一部分的规则名称。
源代码
如果您在此页面中找不到信息,请考虑查看组件的实现以获取更多详细信息。