
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@wertarbyte/material-ui-currency-textfield
Advanced tools
CurrencyTextField
is a React component built using Material UI's TextField
and react-number-format
. It provides a text field for currency input, supporting custom formatting options.
# npm
npm install @wertarbyte/material-ui-currency-textfield
# yarn
yarn add @wertarbyte/material-ui-currency-textfield
import * as React from 'react';
import Dinero from 'dinero.js';
import { CurrencyTextField } from '@wertarbyte/material-ui-currency-textfield';
export const MyComponent: React.FC = () => {
const [value, setValue] = React.useState<Dinero.Dinero>();
return (
<CurrencyTextField
label={'Amount'}
name={'amount'}
value={value}
variant={'outlined'}
currencySymbol="€"
currency="EUR"
precision={2}
minimumValue={0}
decimalCharacter=","
digitGroupSeparator="."
onChange={(value) => {
setValue(value);
}}
/>
);
};
Name | Type | Default | Description |
---|---|---|---|
decimalCharacter | string | '.' | The character used as the decimal separator. |
digitGroupSeparator | string | ',' | The character used as the thousand separator. |
currency | Dinero.Currency | 'USD' | ISO 4217 CURRENCY CODES as specified in the documentation. Sorted and parsed |
currencySymbol | string | '$' | The symbol used as the currency prefix. |
minimumValue | string number | '-10000000000000' | The minimum allowable value as a string. |
maximumValue | string number | '10000000000000' | The maximum allowable value as a string. |
precision | number | 2 | The number of decimal places to display. |
value | Dinero.Dinero | The current value of the text field. Can be a number or a string. | |
defaultValue | Dinero.Dinero | The default value of the text field. | |
onChange | func | Callback function that is called when the value changes. Receives the new value and formatted value as arguments. | |
onBlur | func | Callback function that is called when the input loses focus. Receives the event and value as arguments. |
The library can be easily testet in dev mode via the provided 'dev' script and App.tsx.
# npm
npm run dev
# yarn
yarn dev
FAQs
Currency textField for React Material UI
The npm package @wertarbyte/material-ui-currency-textfield receives a total of 3 weekly downloads. As such, @wertarbyte/material-ui-currency-textfield popularity was classified as not popular.
We found that @wertarbyte/material-ui-currency-textfield demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.