2.0.2 • Published 5 months ago

digital-digit v2.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 months ago

digital-digit Weekly downloads

A digital digit which can display any digit from 0 to 9 and a component which be used to create a custom sign by lighting different segments of it


Demo

You can access the storybook for these components here.

Props

There are two components. One for displaying digits (DigitalDigit) and one generic (DigitalDigitRaw) used by the first component.

Props accepted by DigitalDigit

NameTypeRequiredDefaultDescription
colorstringyes-The color of the segments
digit0 .. 9yes-The digit to be displayed
opacitySegmentnumberno0.3Controls the opacity of the segments turned off

Props accepted by DigitalDigitRaw

NameTypeRequiredDefaultDescription
abooleannofalseThe top segment
bbooleannofalseThe upper left segment
cbooleannofalseThe upper right segment
colorstringyes-The color of segments
dbooleannofalseThe middle segment
ebooleannofalseThe lower left segment
fbooleannofalseThe lower right segment
gbooleannofalseThe bottom segment
opacitySegmentnumberno0.3Controls the opacity of the segments turned off

All segments set to true (turned on) will be filled with the specified color.


Versions

DigitalDigit usesReact
1.0.x16.9.0
1.1.x16.9.0
1.2.x16.9.0 or 17.0.0
2.0.x18.0.0

About versioning schema used for DigitalDigit

  • Major - it will be increased if the major version of the dependat package changes or there are breaking changes in the code of DigitalDigit or DigitalDigitRaw
  • Minor - it will be increased if no major version of the dependat package changes, but there are changes of the minor or patch versions of it
  • Patch - it will be increased if there are no changes of the dependat packages, but there are non breaking changes in the code of DigitalDigit or DigitalDigitRaw

Example

Displaying a digit:

import * as React from 'react';
import DigitalDigit from 'digital-digit';

class App extends React.Component {
  render() {
    return (
      <div className="App">
        <DigitalDigit digit={2} color="black" opacitySegment={0.7} />
      </div>
    );
  }
}

export default App;

Displaying the digit 4 using the raw component:

import * as React from 'react';
import { DigitalDigitRaw } from 'digital-digit';

class App extends React.Component {
  render() {
    return (
      <div className="App">
        <DigitalDigitRaw b={true} c={true} d={true} f={true} color="black" />
      </div>
    );
  }
}

export default App;

Changelog

1.0.0

  • digital-digit is made publicly available

1.0.1

  • Made the digit to take only the needed width

1.0.2

  • Added a property for changing the opacity of the segments

1.1.0

  • Updated the packages

1.1.1

  • Updated the packages
  • Moved from npm to yarn

1.1.2

  • Updated the packages

1.1.3

  • Updated the packages

1.1.4

  • Fixed crash produced by "export * from"

1.2.0

  • Accepting React 17 as peerDependencies

1.2.1

  • Updated the packages

1.2.2

  • Updated the packages

2.0.0

  • Minimum accepted React version is 18
2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

1 year ago

1.2.2

2 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago