radix-vue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
3.53k stars 204 forks source link

[Feature]: Add option for icons to the Auto Form inputs #555

Open koddr opened 1 month ago

koddr commented 1 month ago

Describe the feature

It would be great if it were possible to add Inputs with icons into the Auto Form component.

For example, as standalone option icon (like component or else):

<script setup lang="ts">
import { Search } from 'lucide-vue-next'

// ...
</script>

<template>
  <AutoForm
    :field-config="{
      searchField: {
        inputProps: {
          type: 'text',
          placeholder: 'Search...',
          showLabel: false,
        },
        icon: {
          position: 'left', // or 'right'
          component: Search, // place imported icon component here
        },
        // ...
      },
    }"
  />
</template>

And result something like this:

screenshot

Additional information