shadcn-vue/packages/module/playground/components/ui/button/Button.vue
zernonia 7586b5e15c
feat: Nuxt module (#197)
* feat: add nuxt module

* chore: bundle module

* chore: update package, readme

* docs: update nuxt installation with new module

* docs: remove Ui prefix to prevent confusion

* chore: cleanup
2023-12-01 11:31:27 +08:00

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>