Socket
Socket
Sign inDemoInstall

react-linkify

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-linkify

React component to parse links (urls, emails, etc.) in text into clickable links


Version published
Weekly downloads
240K
increased by7.08%
Maintainers
1
Install size
14.1 kB
Created
Weekly downloads
 

Readme

Source

react-linkify

React component to parse links (urls, emails, etc.) in text into clickable links

Installation

npm install react-linkify --save

Usage

var Linkify = require('react-linkify');

React.render(
  <Linkify>Examples are available at tasti.github.io/react-linkify/.</Linkify>,
  document.body
);

Properties

component
The type of component to wrap links in.
type: any
default: 'a'

properties
The props that will be added to every matched component.
type: object
default: {href: Linkify.MATCH}

NOTE: Use Linkify.MATCH as a value to specify the matched link.

urlRegex
The regular expression used to identify url links.
type: object
default: /\b(?:(?:https):\/\/|[-A-Z0-9+&@#/%=~_|$?!:,.]+\.)(?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[A-Z0-9+&@#/%=~_|$])/i

NOTE: I recommend that you use the default regex. If you want to modify it for some use case, it's probably better to file an issue and change the default since someone else might have the same issue.

Some of the cases the default regex handles (bold is the link):

Examples

Examples are available at tasti.github.io/react-linkify/.

Keywords

FAQs

Last updated on 01 Jun 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc