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.
26 lines
612 B
26 lines
612 B
<script setup lang="ts"> |
|
import type { HTMLAttributes } from 'vue' |
|
import { cn } from '@/lib/utils' |
|
import { Primitive, type PrimitiveProps } from 'reka-ui' |
|
import { type ButtonVariants, buttonVariants } from '.' |
|
|
|
interface Props extends PrimitiveProps { |
|
variant?: ButtonVariants['variant'] |
|
size?: ButtonVariants['size'] |
|
class?: HTMLAttributes['class'] |
|
} |
|
|
|
const props = withDefaults(defineProps<Props>(), { |
|
as: 'button', |
|
}) |
|
</script> |
|
|
|
<template> |
|
<Primitive |
|
:as="as" |
|
:as-child="asChild" |
|
:class="cn(buttonVariants({ variant, size }), props.class)" |
|
> |
|
<slot /> |
|
</Primitive> |
|
</template>
|
|
|