Skip to content

ModalInput

A text input with a built-in modal/dialog trigger button. Useful for opening a selection modal from within a form field, showing the selected value as read-only text.

Usage

vue
<script setup>
import { ref } from 'vue'
import { ModalInput } from 'praxis-vue-ui'

const value = ref('')
const showModal = ref(false)

const openModal = () => { showModal.value = true }
</script>

<template>
  <ModalInput
    :model-value="value"
    label="Provider"
    placeholder="Click to select a provider..."
    @click="openModal"
  />

  <MyProviderModal v-model:visible="showModal" @select="value = $event" />
</template>

Props

PropTypeDefaultDescription
modelValuestring''Text value displayed in the read-only input.
labelstringundefinedLabel above the input.
placeholderstring''Placeholder text when no value is selected.
requiredbooleanfalseShows required asterisk.
disabledbooleanfalseDisables the trigger button.

Emits

EventPayloadDescription
clickvoidEmitted when the modal trigger button is clicked.

Built with VitePress