@agoric/ui-components

0.3.9-u14.0 • Public • Published

UI Components

Reusable UI Components for Agoric Dapps, built with React and MaterialUI.

NatAmountInput

A React MaterialUI TextField Input which allows the user to enter a Nat. Handles decimalPlaces appropriately. This is a controlled component.

Example:

import { NatAmountInput } from '@agoric/ui-components';

<NatAmountInput
  label={label} // the label
  value={amount && amount.value} // The value to display. Must be a Nat
  decimalPlaces={purse.displayInfo && purse.displayInfo.decimalPlaces}
  placesToShow={2}
  disabled={disabled} // disable the input
  error={amountError} // any error to display
  onChange={onAmountChange} // a callback called on user input changing the value
  onError={() => {}} // a callback called on errors
/>

Yarn Test

yarn build
yarn test

Package Sidebar

Install

npm i @agoric/ui-components

Weekly Downloads

10,163

Version

0.3.9-u14.0

License

Apache-2.0

Unpacked Size

68.3 kB

Total Files

41

Last publish

Collaborators

  • gibson042
  • mhofman
  • samsiegart
  • jimlarson
  • agoricbot
  • warner
  • erights
  • michaelfig
  • kriskowal