跳到内容
+

边框

使用边框实用工具快速设置元素的边框和 border-radius 样式。非常适合图像、按钮或任何其他元素。

边框

使用边框实用工具添加或移除元素的边框。可以选择所有边框或一次选择一个。

添加型

<Box sx={{ border: 1 }}><Box sx={{ borderTop: 1 }}><Box sx={{ borderRight: 1 }}><Box sx={{ borderBottom: 1 }}><Box sx={{ borderLeft: 1 }}>

减去型

<Box sx={{ border: 0 }}><Box sx={{ borderTop: 0 }}><Box sx={{ borderRight: 0 }}><Box sx={{ borderBottom: 0 }}><Box sx={{ borderLeft: 0 }}>

边框颜色

<Box sx={{ borderColor: 'primary.main' }}><Box sx={{ borderColor: 'secondary.main' }}><Box sx={{ borderColor: 'error.main' }}><Box sx={{ borderColor: 'grey.500' }}><Box sx={{ borderColor: 'text.primary' }}>

Border-radius

<Box sx={{ borderRadius: '50%' }}><Box sx={{ borderRadius: 1 }}>// theme.shape.borderRadius * 1
<Box sx={{ borderRadius: '16px' }}>

API

import { borders } from '@mui/system';
导入名称 Prop CSS 属性 主题键
border border border borders
borderTop borderTop border-top borders
borderLeft borderLeft border-left borders
borderRight borderRight border-right borders
borderBottom borderBottom border-bottom borders
borderColor borderColor border-color palette
borderTopColor borderTopColor border-top-color palette
borderRightColor borderRightColor border-right-color palette
borderBottomColor borderBottomColor border-bottom-color palette
borderLeftColor borderLeftColor border-left-color palette
borderRadius borderRadius border-radius shape