button
shadcn-vue/buttonFreeComponent
shadcn-vue publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-vue on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-vue.com/r/styles/new-york/button.jsonSource
1<script setup lang="ts">2import type { PrimitiveProps } from "reka-ui"3import type { HTMLAttributes } from "vue"4import type { ButtonVariants } from "."5import { Primitive } from "reka-ui"6import { cn } from "@/lib/utils"7import { buttonVariants } from "."89interface Props extends PrimitiveProps {10 variant?: ButtonVariants["variant"]11 size?: ButtonVariants["size"]12 class?: HTMLAttributes["class"]13}1415const props = withDefaults(defineProps<Props>(), {16 as: "button",17})18</script>1920<template>21 <Primitive22 :as="as"23 :as-child="asChild"24 :class="cn(buttonVariants({ variant, size }), props.class)"25 >26 <slot />27 </Primitive>28</template>
What it pulls in
npm packages
Files it writes
More from shadcn-vue
All 65 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-vue | Components | Free | 2 deps · 5 files | |
| alertalert | shadcn-vue | Components | Free | no deps · 4 files | |
| alert-dialogalert-dialog | shadcn-vue | Components | Free | 2 deps · 10 files | |
| aspect-ratioaspect-ratio | shadcn-vue | Components | Free | 1 dep · 2 files | |
| attachmentattachment | shadcn-vue | Components | Free | 1 dep · 10 files | |
| avataravatar | shadcn-vue | Components | Free | 2 deps · 4 files | |
| badgebadge | shadcn-vue | Components | Free | 2 deps · 2 files | |
| breadcrumbbreadcrumb | shadcn-vue | Components | Free | 1 dep · 8 files |
