0.6.0 • Published 2 years ago

@growth-ui/currency-input v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Install

npm install @growth-ui/currency-input

or

yarn add @growth-ui/currency-input

Usage

import CurrencyInput from ' @growth-ui/currency-input';

<CurrencyInput
  defaultValue={0}
  fixed={2}
  onChange={(value, props) => console.log(value, props)}
/>;

Props

NameTypeDefaultDescription
basicbooleanfalseAn input can be just pure html input look and feel.
compactbooleanfalseAn input can reduce its padding to fit into tighter spaces.
decimalsLimitnumber2Limit length of decimals allowed.
defaultValuenumberDefault value.
errorbooleanAn Input field can show the data contains errors.
fixednumberValue will always have the specified length of decimals.
focusbooleanAn input field can show a user is currently interacting with it.
onBlurfuncCalled on blur.
onChangefuncCalled on change.
onFocusfuncCalled on focus.
placeholderstringPlaceholder if no value
prefixstringAn input can be descriptive. e.g) $
separatorsbooleanAn input can format number with commas as thousands separators.
sizenumberAn input can have different sizes.
valuenumberAn input value.

Prefix

You can add a prefix or suffix by passing in prefix or suffix.

import CurrencyInput from ' @growth-ui/currency-input';

<CurrencyInput prefix="£" value={123} />;
// £123

For more examples and interactions, visit growth-ui-react.

Looking for UI library?

Check out our react ui library Growth-UI-React.

Check out our native ui library Growth-UI-Native.

Credit

Created by @kyuhakyuk.

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.0

2 years ago