Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

668 B
Raw Blame
<script setup lang="ts">
  import type { HTMLAttributes } from "vue";
  import { Primitive, type PrimitiveProps } from "reka-ui";
  import { type ButtonVariants, buttonVariants } from ".";
  import { cn } from "@/lib/utils";

  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)"
    :data-button="true"
  >
    <slot />
  </Primitive>
</template>