1.0.0 • Published 4 years ago
@jswork/react-digital v1.0.0
react-digital
React digital.
installation
npm install -S @jswork/react-digital
properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | - | The extended className for component. |
value | any | false | ':' | Default value. |
onChange | func | false | noop | The change handler. |
flat | bool | false | false | If digit equal width. |
usage
import css
@import "~@jswork/react-digital/dist/style.css"; // or use sass @import "~@jswork/react-digital/dist/style.scss"; // customize your styles: $react-digital-options: ()
import js
import ReactDemokit from '@jswork/react-demokit'; import React from 'react'; import ReactDOM from 'react-dom'; import ReactDigital from '@jswork/react-digital'; import './assets/style.scss'; class App extends React.Component { render() { return ( <ReactDemokit className="p-3 app-container" url="https://github.com/afeiship/react-digital"> <div className="dib_ mr5_" style={{ fontSize: 20 }}> <ReactDigital value={2} /> <ReactDigital value={0} /> <ReactDigital value={1} /> <ReactDigital value={7} /> <ReactDigital value={'-'} /> <ReactDigital value={1} /> <ReactDigital value={2} /> <ReactDigital value={'-'} /> <ReactDigital value={0} /> <ReactDigital value={7} /> </div> <div className="mr5_" style={{ fontSize: 10, marginTop: 20 }}> <ReactDigital flat className="dib" value={0} /> <ReactDigital flat className="dib" value={0} /> <ReactDigital flat className="dib" value={':'} /> <ReactDigital flat className="dib" value={1} /> <ReactDigital flat className="dib" value={6} /> <ReactDigital flat className="dib" value={':'} /> <ReactDigital flat className="dib" value={0} /> <ReactDigital flat className="dib" value={0} /> </div> </ReactDemokit> ); } } ReactDOM.render(<App />, document.getElementById('app'));
documentation
license
Code released under the MIT license.
1.0.0
4 years ago