You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
787 B

<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { Separator as SeparatorPrimitive } from 'reka-ui'
import { cn } from '@/lib/utils'
interface SeparatorProps {
orientation?: 'horizontal' | 'vertical'
decorative?: boolean
class?: HTMLAttributes['class']
}
const props = withDefaults(
defineProps<SeparatorProps>(),
{
orientation: 'horizontal',
decorative: true,
}
)
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
</script>
<template>
<SeparatorPrimitive
v-bind="delegatedProps"
:class="
cn(
'shrink-0 bg-border',
props.orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
props.class
)
"
/>
</template>