# flowtype-es

> No Library version of FlowType.js

Latest version **1.0.0** (published 2018-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install flowtype-es
pnpm add flowtype-es
yarn add flowtype-es
bun add flowtype-es
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-09-24 |
| First published | 2018-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fritz Lekschas |
| Maintainers | flekschas |
| Keywords | font, responsive, no library, es6, FlowType.js |

## Links

- npm: https://www.npmjs.com/package/flowtype-es
- Repository: https://github.com/flekschas/flowtype
- Issues: https://github.com/flekschas/flowtype/issues
- npm.io page: https://npm.io/package/flowtype-es

## Dependencies (1)

- [with-raf](https://npm.io/package/with-raf.md) ^1.0.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-09-24

## README

# ES6 FlowType.js

[![Build Status](https://travis-ci.org/flekschas/flowtype.svg?branch=master)](https://travis-ci.org/flekschas/flowtype)

> FlowType ES is a rewrite of the awesome [FlowType.JS](http://simplefocus.com/flowtype/) in ES6. It doesn't require jQuery and triggers recalculation on requestAnimationFrame.

## Install

```
npm install flowtype-es
```

## API

```javascript
import createFlowtype from "flowtype-es";
```

### `const flowtype = createFlowtype(element, options)`

Creates and attaches event listeners for automatic recalculation of the font size upon resizing the `element`.

- `element` is a reference to the dom element for which the font size should be calculated automatically.
- `options` lets you customize the calculation of the font size.

**Returns** an object with `update()` and `destroy()`.

### `flowtype.update()`

Triggers a recalculation of the font size.

### `flowtype.destroy()`

Removes all event listeners and stops the automatic recalculation of the font size upon resizing the `element`.

### Options

| Option    | Description                                                            | Dtype | Default |
| --------- | ---------------------------------------------------------------------- | ----- | ------- |
| maximum   | Max width of the element until the font size is controlled             | int   | 1200    |
| minimum   | Min width of the element until the font size is controlled             | int   | 500     |
| maxFont   | Max font size ever used                                                | int   | 40      |
| minFont   | Min font size ever used                                                | int   | 12      |
| fontRatio | Font ratio for determining the font size based on the elements's width | int   | 30      |

## Example

```javascript
import createFlowtype from "flowtype-es";

const flowtype = createFlowtype(document.body, {
  maximum: 1200,
  minimum: 500,
  maxFont: 40,
  minFont: 12,
  fontRatio: 30
});
```

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