4.54.23 • Published 6 months ago

@cutting/svg v4.54.23

Weekly downloads
3
License
MIT
Repository
github
Last release
6 months ago

@cutting/svg - reusable svg components for SVG documents

npm version code style: prettier

install

pnpm add @cutting/svg

# or

npm install @cutting/svg

ParentsizeSVG

A react component that will resize and scale to the dimensions of the supplied react ref object.

svg document resizing to scale when using the ParentsizeSVG component

The ParentsizeSVG component takes an parentRef prop that should point to a valid HTML DOM element.

usage

import { useRef } from 'react';
import { ParentsizeSVG } from '@cutting/svg';

export function App(): JSX.Element {
  const ref = useRef<HTMLDivElement>(null);

  return (
    <div className={styles.container} ref={ref}>
      <ParentsizeSVG ref={ref}>
        <rect
          x="20%"
          y="20%"
          width={'50%'}
          height={'50%'}
          rx="20"
          style={{ fill: '#ff0000', stroke: '#000000', strokeWidth: '2px' }}
        />
      </ParentsizeSVG>
    </div>
  );
};
4.54.22

7 months ago

4.54.21

7 months ago

4.54.23

6 months ago

4.54.20

7 months ago

4.54.19

8 months ago

4.54.18

9 months ago

4.54.17

9 months ago

4.54.16

9 months ago

4.54.15

10 months ago

4.54.14

11 months ago

4.54.13

1 year ago

4.54.11

1 year ago

4.54.10

1 year ago

4.54.12

1 year ago

4.54.9

1 year ago

4.54.8

2 years ago

4.54.7

2 years ago

4.54.5

2 years ago

4.54.6

2 years ago

4.54.0

2 years ago

4.54.3

2 years ago

4.54.4

2 years ago

4.54.1

2 years ago

4.54.2

2 years ago

4.53.0

2 years ago

4.53.1

2 years ago

4.52.2

2 years ago

4.52.1

2 years ago

4.52.0

2 years ago

4.50.2

2 years ago

4.51.0

2 years ago

4.50.1

2 years ago

4.49.0

2 years ago

4.50.0

2 years ago

4.47.0

2 years ago

4.48.0

2 years ago

4.46.0

3 years ago

4.45.3

3 years ago

4.39.1

3 years ago

4.39.0

3 years ago

4.37.2

3 years ago

4.37.1

3 years ago

4.37.0

3 years ago

4.42.0

3 years ago

4.40.1

3 years ago

4.40.0

3 years ago

4.44.0

3 years ago

4.35.0

3 years ago

4.38.0

3 years ago

4.43.0

3 years ago

4.41.2

3 years ago

4.41.1

3 years ago

4.41.0

3 years ago

4.45.2

3 years ago

4.45.1

3 years ago

4.43.3

3 years ago

4.45.0

3 years ago

4.43.2

3 years ago

4.41.4

3 years ago

4.43.1

3 years ago

4.41.3

3 years ago

4.36.0

3 years ago

4.34.1

3 years ago

4.34.0

3 years ago

4.31.9

3 years ago

4.33.0

3 years ago

4.32.0

3 years ago

4.32.1

3 years ago

4.31.8

3 years ago

4.31.6

3 years ago

4.31.4

3 years ago

4.31.3

3 years ago

4.31.2

3 years ago

4.31.0

3 years ago

4.29.1

3 years ago

4.29.0

3 years ago

4.30.1

3 years ago

4.30.0

3 years ago

4.28.2

3 years ago

4.28.1

3 years ago

4.28.0

3 years ago

4.27.1

3 years ago

4.27.0

4 years ago

4.26.1

4 years ago

4.25.0

4 years ago

4.26.0

4 years ago

4.25.1

4 years ago

4.22.0

4 years ago

4.21.1

4 years ago

4.23.0

4 years ago

4.24.0

4 years ago

4.23.1

4 years ago

4.24.1

4 years ago

4.21.0

4 years ago

4.20.1

4 years ago

4.20.0

4 years ago

4.19.0

4 years ago

4.18.0

4 years ago

4.17.0

4 years ago

4.16.0

4 years ago

4.15.0

4 years ago

4.13.0

4 years ago

4.14.0

4 years ago

4.11.0

4 years ago

4.10.0

4 years ago

4.9.0

4 years ago

4.8.3

4 years ago

4.8.0

4 years ago

4.8.2

4 years ago

4.7.0

4 years ago

4.6.4

4 years ago

4.6.3

4 years ago

4.6.2

4 years ago

4.6.1

4 years ago

4.6.0

4 years ago

4.5.0

4 years ago