Socket
Book a DemoInstallSign in
Socket

digital-digit

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

digital-digit

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

2.0.2
latest
Source
npmnpm
Version published
Weekly downloads
18
Maintainers
1
Weekly downloads
 
Created
Source

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.1

  • Updated the packages

2.0.2

  • Fixed bundled lib

Keywords

digit

FAQs

Package last updated on 10 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.