# react-curved-text

> A library for creating circular / curved texts in React projects

Latest version **3.0.1** (published 2024-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-curved-text
pnpm add react-curved-text
yarn add react-curved-text
bun add react-curved-text
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2024-02-08 |
| First published | 2022-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-curved-text) |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 67.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | ahmetemrekilinc |
| Maintainers | ahmetemrekilinc |
| Keywords | react, curved text, curved, circular, arc |

## Links

- npm: https://www.npmjs.com/package/react-curved-text
- Repository: https://github.com/obss/react-curved-text
- Homepage: https://obss.github.io/react-curved-text
- Issues: https://github.com/obss/react-curved-text/issues
- npm.io page: https://npm.io/package/react-curved-text

## Dependencies (1)

- [svg-path-commander](https://npm.io/package/svg-path-commander.md) 1.0.5

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2024-02-08
- 3.0.0-beta.2 (beta) — 2023-10-30
- 3.0.0 — 2023-10-30
- 3.0.0-beta.1 — 2023-10-30
- 2.0.2 — 2023-03-17
- 2.0.1 — 2023-03-03
- 2.0.0 — 2023-03-03
- 1.0.0 — 2022-09-22
- 0.9.0 — 2022-09-22
- 0.8.0 — 2022-09-22
- 0.7.1 — 2022-09-22
- 0.7.0 — 2022-09-22
- 0.6.1 — 2022-09-22
- 0.6.0 — 2022-09-22
- 0.5.1-beta — 2022-09-22
- … 7 more at https://npm.io/package/react-curved-text/versions

## README

# react-curved-text <!-- omit in toc -->

> react-curved-text a library for creating circular / curved texts in React projects.

<img alt="exampletext" src="https://raw.githubusercontent.com/obss/react-curved-text/master/public/curved-text-example.png" />

## Installation

**react-curved-text** requires:

-   React **18.0.0** or later

```shell
yarn add react-curved-text
```

or

```shell
npm install react-curved-text
```

## Usage

```js
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](https://obss.github.io/react-curved-text) page for various customizations.

Checkout a [Live Example with Rotate Animation](https://stackblitz.com/edit/react-curved-text-animation).


## API

| **Prop**          | **Type** | **Required** | **Description**                            |
| ----------------- | -------- | ------------ | ------------------------------------------ |
| **text**          | string   | yes          | Text to be displayed                       |
| **width**         | number   | yes          | Width of the SVG                           |
| **height**        | number   | yes          | Height of the SVG                          |
| **cx**            | number   | yes          | Center x of the ellipse                    |
| **cy**            | number   | yes          | Center y of the ellipse                    |
| **rx**            | number   | yes          | Radius x of the ellipse                    |
| **ry**            | number   | yes          | Radius y of the ellipse                    |
| **startOffset**   | number   | no           | Start offset of the text                   |
| **reversed**      | boolean  | no           | Reverse the text path                      |
| **textProps**     | object   | no           | Props to be passed to the text element     |
| **textPathProps** | object   | no           | Props to be passed to the textPath element |
| **tspanProps**    | object   | no           | Props to be passed to the tspan element    |
| **ellipseProps**  | object   | no           | Props to be passed to the ellipse element  |
| **svgProps**      | object   | no           | Props to be passed to the svg element      |

---
_Source: https://npm.io/package/react-curved-text · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
