input

Complex input form with multiple fields

Complex input form with multiple fields

Загрузка превью…

src/input/c-input-15.vue

<script setup lang="ts">
import { Button } from "@/components/ui/button"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
</script>

<template>
  <form class="w-full">
    <FieldGroup>
      <div class="grid grid-cols-2 gap-4">
        <Field>
          <FieldLabel for="form-phone">Phone</FieldLabel>
          <Input id="form-phone" type="tel" placeholder="+1 (555) 123-4567" />
        </Field>
        <Field>
          <FieldLabel for="form-country">Country</FieldLabel>
          <Select model-value="us">
            <SelectTrigger id="form-country">
              <SelectValue />
            </SelectTrigger>
            <SelectContent>
              <SelectItem value="us">United States</SelectItem>
              <SelectItem value="uk">United Kingdom</SelectItem>
              <SelectItem value="ca">Canada</SelectItem>
            </SelectContent>
          </Select>
        </Field>
      </div>
      <Field>
        <FieldLabel for="form-address">Address</FieldLabel>
        <Input id="form-address" type="text" placeholder="123 Main St" />
      </Field>
      <div class="flex justify-end gap-3 pt-4">
        <Button type="button" variant="outline">Cancel</Button>
        <Button type="submit">Submit</Button>
      </div>
    </FieldGroup>
  </form>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-input-15.json

Зависимости реестра

Источник: порт из ReUI (Keenthemes, MIT)