Skip to content

Commit c95c7c1

Browse files
committed
feat: add divider component
1 parent f474827 commit c95c7c1

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import styles from "./styles/index.module.scss";
3+
import classNames from "classnames";
4+
5+
export interface DividerProps extends React.HTMLAttributes<HTMLHRElement> {
6+
type?: "vertical" | "horizontal";
7+
}
8+
9+
export const Divider = ({
10+
type = "horizontal",
11+
className,
12+
...otherProps
13+
}: Readonly<DividerProps>): React.ReactElement => (
14+
<hr className={classNames(styles.root, styles[type], className)} {...otherProps} />
15+
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@import "@rck/theme";
2+
3+
.root {
4+
background-color: get-color("neutral200");
5+
border: none;
6+
height: var(--height);
7+
width: var(--width);
8+
}
9+
10+
.horizontal {
11+
--width: 100%;
12+
--height: 1px;
13+
}
14+
15+
.vertical {
16+
--width: 1px;
17+
--height: 100%;
18+
}

0 commit comments

Comments
 (0)