react-jsbarcode 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -9,7 +9,11 @@
9
9
 
10
10
  ## About
11
11
 
12
- This is a [React](https://reactjs.org) component wrapping up [jsbarcode](<[https://](https://github.com/lindell/JsBarcode)>). Written as a React functional component using React hooks.
12
+ This is a [React](https://reactjs.org) component wrapping up [jsbarcode](<[https://](https://github.com/lindell/JsBarcode)>). Written as a React functional component using React hooks. <ReactBarcode />
13
+
14
+ ## CodeSandbox Demo
15
+
16
+ [![Edit react-jsbarcode](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-jsbarcode-2659g?fontsize=14&hidenavigation=1&theme=dark)
13
17
 
14
18
  ## Installation
15
19
 
@@ -27,11 +31,23 @@ yarn add react-jsbarcode
27
31
 
28
32
  ## Usage
29
33
 
34
+ - Basic usage
35
+
30
36
  ```tsx
31
- import ReactJSBarcode from 'react-jsbarcode';
37
+ import Barcode from 'react-jsbarcode';
32
38
 
33
39
  const App = () => {
34
- return <ReactJSBarcode value="ABC123" options={{ format: 'code128' }} renderer="svg" />;
40
+ return <Barcode value="ABC123" />;
41
+ };
42
+ ```
43
+
44
+ - Advanced usage
45
+
46
+ ```tsx
47
+ import Barcode from 'react-jsbarcode';
48
+
49
+ const App = () => {
50
+ return <Barcode value="ABC123" options={{ format: 'code128' }} renderer="svg" />;
35
51
  };
36
52
  ```
37
53
 
@@ -40,3 +56,5 @@ For all options refer jsbarcode [wiki](https://github.com/lindell/JsBarcode/wiki
40
56
  ### Renderers
41
57
 
42
58
  JSBarcode supports rendering to SVG, image and canvas. Default renderer is 'svg'.
59
+
60
+ [![Edit react-jsbarcode](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-jsbarcode-2659g?fontsize=14&hidenavigation=1&theme=dark)
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { Options } from 'jsbarcode';
3
3
  export declare const enum Renderer {
4
4
  svg = "svg",
@@ -15,4 +15,3 @@ export interface ReactBarcodeProps {
15
15
  export { Options };
16
16
  declare const ReactBarcode: ({ style, className, value, options, renderer }: ReactBarcodeProps) => JSX.Element;
17
17
  export default ReactBarcode;
18
- //# sourceMappingURL=index.d.ts.map