3.0.1 • Published 3 months ago

react-curved-text v3.0.1

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

react-curved-text

react-curved-text a library for creating circular / curved texts in React projects.

Installation

react-curved-text requires:

  • React 18.0.0 or later
yarn add react-curved-text

or

npm install react-curved-text

Usage

import ReactCurvedText from 'react-curved-text';

const MyComponent = () => {
    return (
        <ReactCurvedText
            width={300}
            height={300}
            cx={150}
            cy={150}
            rx={100}
            ry={100}
            startOffset={50}
            reversed={false}
            text="react-curved-text"
            textProps={{ style: { fontSize: 24 } }}
            textPathProps={null}
            tspanProps={null}
            ellipseProps={null}
            svgProps={null}
        />
    );
};

export default MyComponent;

Examples

Checkout live examples on react-curved-text-demo page for various customizations.

Checkout a Live Example with Rotate Animation.

API

PropTypeRequiredDescription
textstringyesText to be displayed
widthnumberyesWidth of the SVG
heightnumberyesHeight of the SVG
cxnumberyesCenter x of the ellipse
cynumberyesCenter y of the ellipse
rxnumberyesRadius x of the ellipse
rynumberyesRadius y of the ellipse
startOffsetnumbernoStart offset of the text
reversedbooleannoReverse the text path
textPropsobjectnoProps to be passed to the text element
textPathPropsobjectnoProps to be passed to the textPath element
tspanPropsobjectnoProps to be passed to the tspan element
ellipsePropsobjectnoProps to be passed to the ellipse element
svgPropsobjectnoProps to be passed to the svg element
3.0.1

3 months ago

3.0.0-beta.1

6 months ago

3.0.0-beta.2

6 months ago

3.0.0

6 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1-beta

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago