Skip to content

πŸŒ€ React library to safely render HTML, filter attributes, autowrap text with matchers, render emoji characters, and much more.

License

Notifications You must be signed in to change notification settings

milesj/interweave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 10, 2025
37521e6 Β· Feb 10, 2025
Mar 4, 2022
Mar 4, 2022
Mar 4, 2022
Feb 10, 2025
Mar 5, 2022
Mar 4, 2022
Dec 19, 2023
Mar 4, 2022
Mar 4, 2022
Oct 17, 2019
Dec 14, 2018
Mar 4, 2022
Feb 8, 2021
Mar 20, 2020
Mar 5, 2022
Mar 4, 2022
Mar 4, 2022
Mar 4, 2022
Mar 4, 2022
Feb 10, 2025

Repository files navigation

Interweave

Build Status npm version npm deps

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!
<Interweave content="This string contains <b>HTML</b> and will safely be rendered!" />
<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