Skip to content

MazInputPrice

MazInputPrice is a standalone component that replaces the standard html input text and formats the text enter according to the currency provided

Basic usage

Enter your price

priceValue: 2

formattedPrice:

vue
<script lang="ts" setup>
import MazInputPrice from 'maz-ui/components/MazInputPrice'
import { ref } from 'vue'

const priceValue = ref(2)
const formattedPrice = ref()
</script>

<template>
  <MazInputPrice
    v-model="priceValue"
    label="Enter your price"
    currency="USD"
    locale="en-US"
    :min="5"
    :max="1000"
    @formatted="formattedPrice = $event"
  />
</template>

Props

NameDescriptionTypeRequiredDefault
model-valuev-model
numberNoundefined
currencyThe currency to usestringNo'EUR'
localeThe locale to usestringNo'fr-FR'
minThe minimum value that the input can acceptnumberNoNumber.NEGATIVE_INFINITY
maxThe maximum value that the input can acceptnumberNoNumber.POSITIVE_INFINITY
no-iconThe input will be displayed without iconbooleanNofalse
blockThe input will be displayed in full widthbooleanNoundefined
errorWill display the input in error state.booleanNoundefined
hintThe hint text to display below the input.stringNoundefined
successWill display the input in success state.booleanNoundefined
warningWill display the input in warning state.booleanNoundefined
currency-optionsOptions for the currency helper - seeOmitNoundefined

Events

Event namePropertiesDescription
update:model-value
input
formatted
blur
focus