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

INFO

Before you have to import the global css files in your project, follow instructions in Getting Started

TIP

This component use MazInput, so it inherits all his props

Basic usage

Enter your price

priceValue: 2

formattedPrice:

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

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

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

Props, Event & Slots

Props

Prop nameDescriptionTypeValuesDefault
modelValue
@model The value of the input
number-undefined
currencyThe currency to usestring-'EUR'
localeThe locale to usestring-'fr-FR'
minThe minimum value that the input can acceptnumber-Number.NEGATIVE_INFINITY
maxThe maximum value that the input can acceptnumber-Number.POSITIVE_INFINITY
noIconThe input will be displayed without iconboolean-false
blockThe input will be displayed in full widthboolean-
errorWill display the input in error state.boolean-
hintThe hint text to display below the input.string-
successWill display the input in success state.boolean-
warningWill display the input in warning state.boolean-
currencyOptionsOptions for the currency helper - seeOmit-

Events

Event namePropertiesDescription
update:model-value
input
formatted
blur
focus

Slots

NameDescriptionBindings
left-icon