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
union-undefined
currencyThe currency to usestring-'EUR'
localeThe locale to usestring-'fr-FR'
minThe minimum value that the input can acceptnumber-0
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-

Events

Event namePropertiesDescription
update:model-value
formatted

Slots

NameDescriptionBindings
left-icon