테두리
테두리 (Borders)
요소의 테두리(border) 와 테두리 반경(border-radius) 을 빠르게 꾸밀 수 있는 유틸리티예요. 이미지, 버튼, 그 밖의 어떤 요소에도 잘 어울려요.
출처: 문서
본문
테두리
테두리 유틸리티로 요소의 테두리를 추가하거나 제거할 수 있어요. 네 방향 모두 한 번에 적용하거나, 원하는 방향 하나만 골라서 적용할 수도 있어요.
더하기 (Additive)
<Box sx={{ border: 1 }}>…
<Box sx={{ borderTop: 1 }}>…
<Box sx={{ borderRight: 1 }}>…
<Box sx={{ borderBottom: 1 }}>…
<Box sx={{ borderLeft: 1 }}>…
빼기 (Subtractive)
<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' }}>…
테두리 반경
<Box sx={{ borderRadius: '50%' }}>…
<Box sx={{ borderRadius: 1 }}>… // theme.shape.borderRadius * 1
<Box sx={{ borderRadius: '16px' }}>…
API
import { borders } from '@mui/system';
| Import name | Prop | CSS property | Theme key |
|---|---|---|---|
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 |