import { Divider } from 'sud-ui';구분선을 구현할 때
import { Divider, Typography } from "sud-ui";
export default function App() {
return (
<div className="flex flex-col justify-center items-center">
<Typography as="span">Top Content</Typography>
<Divider />
<Typography as="span">Bottom Content</Typography>
</div>
);
}import { Divider, Typography } from "sud-ui";
export default function App() {
return (
<div className="flex flex-col justify-center items-center">
<div className="flex justify-center items-center">
<Typography as="span">Top Left Content</Typography>
<Divider vertical content="Divider" height="10em" />
<Typography as="span">Top Right Content</Typography>
</div>
<Divider content="This is Divider" />
<div className="flex justify-center items-center">
<Typography as="span">Bottom Content</Typography>
</div>
</div>
);
}import { Divider, Typography, Card, Radio } from "sud-ui";
import { useState } from "react";
export default function App() {
const [verticalAlign, setVerticalAlign] = useState("center");
const verticalAlignOptions = [
{ label: "top", value: "top" },
{ label: "center", value: "center" },
{ label: "bottom", value: "bottom" }
];
return (
<div className="flex flex-col gap-[20px] justify-center items-center">
<Card style={{ width: "100%" }} shadow="none" colorType="sub">
<div className="flex justify-center">
<Radio.Group
options={verticalAlignOptions}
direction="horizontal"
value={verticalAlign}
onChange={setVerticalAlign}
/>
</div>
</Card>
<div className="flex justify-center items-center">
<Typography as="span">Content</Typography>
<Divider
vertical
content="This"
align={verticalAlign}
height="5em"
/>
<Typography as="span">Content</Typography>
</div>
</div>
);
}import { Divider, Typography } from "sud-ui";
export default function App() {
return (
<div className="flex justify-center items-center">
<Typography as="span">Left Content</Typography>
<Divider vertical />
<Typography as="span">Right Content</Typography>
</div>
);
}import { Divider, Typography, Card, Radio } from "sud-ui";
import { useState } from "react";
export default function App() {
const [align, setAlign] = useState("center");
const alignOptions = [
{ label: "left", value: "left" },
{ label: "center", value: "center" },
{ label: "right", value: "right" }
];
return (
<div className="flex flex-col gap-[20px] justify-center items-center">
<Card style={{ width: "100%" }} shadow="none" colorType="sub">
<div className="flex justify-center">
<Radio.Group
options={alignOptions}
direction="horizontal"
value={align}
onChange={setAlign}
/>
</div>
</Card>
<Divider content="This is Divider" align={align} />
<div className="flex justify-center items-center">
<Typography as="span">Content</Typography>
</div>
</div>
);
}import { Divider, Typography } from "sud-ui";
export default function App() {
return (
<div className="flex flex-col justify-center items-center">
<div className="flex justify-center items-center">
<Typography as="span">Top Left Content</Typography>
<Divider
vertical
content="Divider"
height="10em"
borderType="dashed"
borderWeight={2}
borderColor="forest-4"
color="forest-4"
/>
<Typography as="span">Top Right Content</Typography>
</div>
<Divider content="This is Divider" color="red-6" borderColor="gold" />
<div className="flex justify-center items-center">
<Typography as="span">Bottom Content</Typography>
</div>
</div>
);
}속성 이름 | 설명 | 타입 | 기본값 |
|---|
| content | 구분선 중앙에 표시할 내용 | ReactNode | - |
| align | 내용 정렬 방식 (left, center, right, top, bottom) | left | center | right | top | bottom | center |
| borderWeight | 구분선 두께 | number | 1 |
| borderType | 구분선 스타일 | solid | dashed | dotted | double | groove | ridge | inset | outset | none | solid |
| color | 내용 색상(palette값 또는 HEX code) | string | - |
| borderColor | 구분선 색상(palette값 또는 HEX code) | string | - |
| width | 구분선 너비 | string | number | 100% |
| height | 구분선 높이 | string | number | 2em |
| vertical | 수직 구분선 여부 | boolean | false |
| border | 테두리 표시 여부 | boolean | true |
| colorType | 테마 색상 타입 | default | primary | success | warning | danger | info | red | rose | coral | orange | volcano | apricot | yellow | gold | amber | green | lime | mint | blue | sky | cerulean | indigo | cobalt | navy | purple | plum | orchid | forest | sage | warm-gray | cool-gray | neutral | text | ghost | default |
| className | 추가 클래스명 | string | - |
| style | 추가 스타일 | CSSProperties | {} |