# interweave

> React library to safely render HTML, filter attributes, autowrap text, autolink, and much more.

Latest version **13.1.1** (published 2025-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install interweave
pnpm add interweave
yarn add interweave
bun add interweave
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 13.1.1 |
| Published | 2025-02-10 |
| First published | 2016-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 223.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1153 |
| Author | Miles Johnson |
| Maintainers | milesj |
| Keywords | interweave, inject, interpolate, react, string, component, element, matcher, filter, clean, email, url, autolink, emoji, emojibase, hashtag, html, markup, safe, render, html |

## Links

- npm: https://www.npmjs.com/package/interweave
- Repository: https://github.com/milesj/interweave
- Homepage: https://github.com/milesj/interweave#readme
- Issues: https://github.com/milesj/interweave/issues
- Funding: https://ko-fi.com/milesjohnson
- npm.io page: https://npm.io/package/interweave

## Dependencies (1)

- [escape-html](https://npm.io/package/escape-html.md) ^1.0.3

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 13.1.1 (latest) — 2025-02-10
- 12.0.0-alpha.0 (next) — 2019-10-17
- 13.1.0 — 2023-03-15
- 13.0.0 — 2022-03-05
- 12.9.0 — 2021-10-17
- 12.8.0 — 2021-07-10
- 12.7.2 — 2021-05-14
- 12.7.1 — 2021-03-08
- 12.7.0 — 2021-01-18
- 12.6.0 — 2020-11-07
- 12.5.0 — 2020-03-20
- 12.4.0 — 2020-03-19
- 12.3.0 — 2020-03-13
- 12.2.2 — 2020-03-02
- 12.2.1 — 2020-02-07
- … 72 more at https://npm.io/package/interweave/versions

## README

# Interweave

[![Build Status](https://github.com/milesj/interweave/workflows/Build/badge.svg)](https://github.com/milesj/interweave/actions?query=branch%3Amaster)
[![npm version](https://badge.fury.io/js/interweave.svg)](https://www.npmjs.com/package/interweave)
[![npm deps](https://david-dm.org/milesj/interweave.svg?path=packages/core)](https://www.npmjs.com/package/interweave)

Interweave is a robust React library that can...

- Safely render HTML without using `dangerouslySetInnerHTML`.
- Safely strip HTML tags.
- Automatic XSS and injection protection.
- Clean HTML attributes using filters.
- Interpolate components using matchers.
- Autolink URLs, IPs, emails, and hashtags.
- Render Emoji and emoticon characters.
- And much more!

```tsx
<Interweave content="This string contains <b>HTML</b> and will safely be rendered!" />
```

```tsx
<Interweave
	content="This contains a URL, https://github.com/milesj/interweave, and a hashtag, #interweave, that will be converted to an anchor link!"
	matchers={[new UrlMatcher('url'), new HashtagMatcher('hashtag')]}
/>
```

## Requirements

- React 16.8+ / 17+
- IE 11+
- Emoji support: `fetch`, `sessionStorage`

## Installation

Interweave requires React as a peer dependency.

```
yarn add interweave react
// Or
npm install interweave react
```

## Documentation

[https://interweave.dev](https://interweave.dev)

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