New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-highlight-hashtags

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-highlight-hashtags

Highlight all hashtags in text

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

react-highlight-hashtags

react-highlight-hashtags is component for React to check hashtags in text.

Installation

Using npm:

$ npm install --save react-highlight-hashtags

Then, use as you would anything else:

// using ES modules
import Hashtags from 'react-highlight-hashtags';

Basic usage

Render a <Hashtags> component with ot without a text prop whose value is a valid text. The children prop should be a text.

import React from 'react';
import Hashtags from 'react-highlight-hashtags';

class App extends React.Component {
  render() {
    return (
        <Hashtags> Hi, #highlight #hash tags</Hashtags>
    );
  }
}
import React from 'react';
import Hashtags from 'react-highlight-hashtags';

class App extends React.Component {
  render() {
    return (
        <Hashtags text="Hi, #highlight #hash tags" />
    );
  }
}

props

There is only one optional props.

propdescriptionexample
textany text with or without #hashtags.<Hashtags text="Hi, #highlight #hash tags" />
childrenany text with or without #hashtags.<Hashtags> Hi, #highlight #hash tags</Hashtags>

style

If you are using bootstrap then mark tag will appear in yellow background.

mark {
	background:none;
	color:rgb(250, 93, 58);
	cursor:pointer;
}

About

react-highlight-hashtags is developed and maintained by Krishna Kumar.

Keywords

hashtag

FAQs

Package last updated on 04 Sep 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