Skip to content

Commit 61af41c

Browse files
feat: add separator component
1 parent bae434a commit 61af41c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Root from "./separator.svelte";
2+
3+
export {
4+
Root,
5+
//
6+
Root as Separator,
7+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script lang="ts">
2+
import { Separator as SeparatorPrimitive } from "bits-ui";
3+
import { cn } from "$lib/utils/shadcn-helper.js";
4+
5+
let {
6+
ref = $bindable(null),
7+
class: className,
8+
orientation = "horizontal",
9+
...restProps
10+
}: SeparatorPrimitive.RootProps = $props();
11+
</script>
12+
13+
<SeparatorPrimitive.Root
14+
bind:ref
15+
class={cn(
16+
"bg-border shrink-0",
17+
orientation === "horizontal" ? "h-[1px] w-full" : "min-h-full w-[1px]",
18+
className,
19+
)}
20+
{orientation}
21+
{...restProps}
22+
/>

0 commit comments

Comments
 (0)