# react-adaptive-text

> Simple UI component that allows the font size of a text to adapt automatically to fill the width of an element in one line.

Latest version **1.0.12** (published 2020-06-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2020-06-04 |
| First published | 2020-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 39.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Maxime Duyck |
| Maintainers | maxduyck |
| Keywords | react, component, adaptive, font-size, text, width |

## Links

- npm: https://www.npmjs.com/package/react-adaptive-text
- Homepage: https://github.com/maxduyck/react-adaptive-text#readme
- Issues: https://github.com/maxduyck/react-adaptive-text/issues
- npm.io page: https://npm.io/package/react-adaptive-text

## 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

- 1.0.12 (latest) — 2020-06-04
- 1.0.11 — 2020-06-04
- 1.0.10 — 2020-06-03
- 1.0.9 — 2020-05-29
- 1.0.8 — 2020-05-27
- 1.0.7 — 2020-05-26
- 1.0.6 — 2020-05-24
- 1.0.5 — 2020-05-22
- 1.0.4 — 2020-05-22
- 1.0.3 — 2020-05-19
- 1.0.2 — 2020-05-19
- 1.0.1 — 2020-05-19
- 1.0.0 — 2020-05-18

## README

# AdaptiveText React component

Simple UI component that allows the font size of a text to adapt automatically to fill the width of an element in one line.

![AdaptiveText render example](https://github.com/maxduyck/react-adaptive-text/raw/master/img1.jpg)

## Prerequisites

- react >= 16.8.0

## Install

`npm install --save react-adaptive-text`

## Usage example

```js
import React from 'react';
import AdaptiveText from 'react-adaptive-text';

function BasicExample = () => {
  const wrapperStyle = {
    display: 'flex',
    justifyContent: 'center',
    width: 500,
  };

  return (
    <div style={wrapperStyle}>
      <AdaptiveText
        width="80%"
        text="This text fills 80% width of its container!"
      />
    </div>
  );
};
```

## Options

|Property|Type|Description|
|-|:-:|-|
|**color** *(Optional)*|CSS value|Overrides `color` inheritance|
|**fontFamily** *(Optional)*|CSS value|Overrides `font-family` inheritance|
|**fontSizeMax** *(Optional)*|integer|Maximum font size (in pixels)|
|**fontSizeMin** *(Optional)*|integer|Minimum font size (in pixels)|
|**fontStyle** *(Optional)*|CSS value|Overrides `font-style` inheritance|
|**fontWeight** *(Optional)*|CSS value|Overrides `font-weight` inheritance|
|**text**|string|Text to display|
|**textDecoration** *(Optional)*|CSS value|Overrides `text-decoration` inheritance|
|**width** *(Optional)*|CSS value|Overrides `width` inheritance *(default: `100%`)*|

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