24 lines
488 B
Vue
24 lines
488 B
Vue
<script setup lang="ts">
|
|
import { buttonVariants } from '.'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface Props {
|
|
variant?: NonNullable<Parameters<typeof buttonVariants>[0]>['variant']
|
|
size?: NonNullable<Parameters<typeof buttonVariants>[0]>['size']
|
|
as?: string
|
|
}
|
|
|
|
withDefaults(defineProps<Props>(), {
|
|
as: 'button',
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<component
|
|
:is="as"
|
|
:class="cn(buttonVariants({ variant, size }), $attrs.class ?? '')"
|
|
>
|
|
<slot />
|
|
</component>
|
|
</template>
|