On this page

Input

Install, props and the parts Input is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/input.json

Use

<script setup lang="ts">
import { ref } from 'vue'
import { Field, FieldDescription, FieldLabel } from '@/components/ui/field'
import { Input } from '@/components/ui/input'

const storeName = ref('')
</script>

<template>
  <Field>
    <FieldLabel for="store-name">Store name</FieldLabel>
    <Input id="store-name" v-model="storeName" aria-describedby="store-name-help" />
    <FieldDescription id="store-name-help">Shown on invoices.</FieldDescription>
  </Field>
</template>

Props

Prop Values Notes
v-model / modelValue string, number The value. Emits update:modelValue
defaultValue string, number Starting value when you don’t bind v-model
class string Merged with the Beehexa classes; use it for width, not for colours

Every other attribute (id, type, name, disabled, aria-invalid, aria-describedby, autocomplete, maxlength) goes to the <input>.

Built on

A native <input> with the shadcn-vue Input API, from the control-center copy. Beehexa replaces the colours, sizes and focus with tokens: the 1 px edge turns color.border.focus and a 2 px inset ring of the same colour sits inside it. Disabled uses the disabled colours, not opacity.