input
shadcn-vue/inputFreeComponent
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/input.jsonSource
1<script setup lang="ts">2import type { HTMLAttributes } from "vue"3import { useVModel } from "@vueuse/core"4import { cn } from "@/lib/utils"56const props = defineProps<{7 defaultValue?: string | number8 modelValue?: string | number9 class?: HTMLAttributes["class"]10}>()1112const emits = defineEmits<{13 (e: "update:modelValue", payload: string | number): void14}>()1516const modelValue = useVModel(props, "modelValue", emits, {17 passive: true,18 defaultValue: props.defaultValue,19})20</script>2122<template>23 <input v-model="modelValue" :class="cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)">24</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 |
