Money

April 21, 2026 · View on GitHub

License Stable Downloads Vue JavaScript SCSS npm Issues Merge Requests

Description

Money provides a two-way bound amount field that formats and sanitizes monetary values using accounting-js.

Installation

Install the package:

yarn add @enso-ui/money

The component can be consumed standalone or inside higher-level Enso form packages.

Features

  • exports a single Money component from the package root
  • supports input mode and read-only label mode
  • sanitizes user input and rounds values to the configured precision
  • customizes symbol, decimal separator, thousands separator, and positive/negative/zero formats

Usage

<script setup>
import Money from '@enso-ui/money';
</script>

<Money
    v-model="amount"
    symbol="€"
    :precision="2" />

API

Money

Import: @enso-ui/money

Props:

  • modelValue: number | string | null = null
  • label: boolean = false
  • readonly: boolean = false
  • disabled: boolean = false
  • placeholder: string | null = null
  • symbol: string = '$'
  • decimal: '.' | ',' = '.'
  • thousand: ' ' | '.' | ',' = ','
  • precision: number = 2
  • positive: string = '%s %v'
  • negative: string = '%s (%v)'
  • zero: string = '%s --'
  • tabindex: number | null = null

Emits:

  • update:modelValue

Behavior:

  • shows formatted output when label is enabled
  • enters raw-edit mode on focus
  • sanitizes, rounds, and emits the numeric value on input or blur

Depends On

  • accounting-js for money formatting and parsing.

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

License

MIT