Socket
Socket
Sign inDemoInstall

react-linkify

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

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
206K
decreased by-7.82%
Maintainers
1
Weekly downloads
 
Created

What is react-linkify?

The react-linkify package is a React component that automatically turns plain text URLs in its children into clickable links. It is useful for rendering user-generated content where URLs need to be detected and converted into hyperlinks.

What are react-linkify's main functionalities?

Basic URL Linking

This feature allows you to automatically convert plain text URLs into clickable links. In this example, the URL 'https://www.google.com' will be converted into a clickable link.

```jsx
import React from 'react';
import Linkify from 'react-linkify';

const App = () => (
  <Linkify>
    Here is a link to Google: https://www.google.com
  </Linkify>
);

export default App;
```

Custom Link Component

This feature allows you to customize the appearance and behavior of the links by providing a custom link component. In this example, the custom link component changes the link color to red.

```jsx
import React from 'react';
import Linkify from 'react-linkify';

const CustomLink = ({ href, text }) => (
  <a href={href} style={{ color: 'red' }}>
    {text}
  </a>
);

const App = () => (
  <Linkify componentDecorator={(decoratedHref, decoratedText, key) => (
    <CustomLink href={decoratedHref} text={decoratedText} key={key} />
  )}>
    Here is a link to Google: https://www.google.com
  </Linkify>
);

export default App;
```

Other packages similar to react-linkify

Keywords

FAQs

Package last updated on 30 May 2019

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc