VPromptBar
Barra de prompt para superfícies de IA com anexo, dictation (Voice Pill) e ação send/stop.
<script setup lang="ts">
import { VPromptBar } from 'vueui-nova-kit'
</script>Uso
<script setup lang="ts">
</script>
<template>
</template>Playground
Os controles abaixo são gerados a partir das props declaradas em VPromptBar.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Default
Variação Padrão. Estado padrão do componente; use a aba Controls para experimentar as props ao vivo. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VPromptBar } from 'vueui-nova-kit'
const prompt = ref('')
</script>
<template>
<VPromptBar v-model="prompt" placeholder="Ask anything…" />
</template>With Dictation
Variação Com Dictation. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VPromptBar } from 'vueui-nova-kit'
const prompt = ref('')
const lastError = ref('')
</script>
<template>
<div style="display:flex;flex-direction:column;gap:8px;width:100%">
<VPromptBar
v-model="prompt"
dictation
dictation-lang="pt-BR"
placeholder="Toque no microfone e fale…"
@dictation-error="lastError = $event" />
<p style="margin:0;font-size:12px;color:var(--v-color-text-muted)">
Transcrição: {{ prompt || '—' }}
</p>
<p v-if="lastError" style="margin:0;font-size:12px;color:var(--v-color-error-strong)">
Erro: {{ lastError }}
</p>
</div>
</template>Busy
Variação Busy. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VPromptBar } from 'vueui-nova-kit'
const prompt = ref('Summarize the latest release notes')
</script>
<template>
<VPromptBar v-model="prompt" busy placeholder="Ask anything…" />
</template>Disabled
Variação Desabilitado. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VPromptBar } from 'vueui-nova-kit'
const prompt = ref('Disabled prompt')
</script>
<template>
<VPromptBar v-model="prompt" disabled />
</template>Without Dictation
Variação Sem Dictation. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VPromptBar } from 'vueui-nova-kit'
const prompt = ref('')
</script>
<template>
<VPromptBar v-model="prompt" :dictation="false" placeholder="Text only…" />
</template>No Dictation
Variação Sem Dictation. Props: dictation=false.
Ver código
<script setup lang="ts">
import { VPromptBar } from 'vueui-nova-kit'
</script>
<template>
<VPromptBar v-model="value" :dictation="false" />
</template>Acessibilidade
Textarea com aria-label, botões com labels dedicados, aria-pressed no mic, aria-busy quando ocupado.
Estados
Idle · Ready to send · Busy (stop) · Dictation recording · Disabled.
Motion
| Trigger | Property | Duration | Easing |
|---|---|---|---|
| Voice expand | min-width/background | spring | ease-spring |
| Busy morph | border-radius/scale | spring | ease-spring |
| EQ bars | scaleY | 600ms | ease-in-out |
Respeitar prefers-reduced-motion.
Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
modelValue | string | "" | — |
busy | boolean | false | — |
placeholder | string | "Ask anything…" | — |
motion | VMotionLevel | V_MOTION_DEFAULT ("expressive") | — |
disabled | boolean | false | — |
loading | boolean | false | Envio em andamento: botão enviar mostra spinner, input fica aria-busy e o envio é bloqueado. |
sendLabel | string | — | — |
stopLabel | string | — | — |
attachLabel | string | — | — |
ariaLabel | string | — | — |
dictation | boolean | true | Voice Pill: show dictation mic control (on by default). |
dictationLabel | string | — | — |
dictationLang | string | — | BCP-47 language for speech recognition. |
Events
| Evento | Payload | Descrição |
|---|---|---|
@update:modelValue | value: string | — |
@send | — | — |
@stop | — | — |
@dictation-start | — | — |
@dictation-stop | — | — |
@dictation-error | message: string | — |
Slots
| Slot | Props do slot |
|---|---|
#attachment | — |
Fonte: src/components/form/VPromptBar/VPromptBar.vue · tipos: src/components/form/VPromptBar/VPromptBar.types.ts