Navigation Menu

Skip to content

peritpatrio/react-autolinker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-autolinker

React component that wraps Autolinker.js

Usage

const text = 'Foo http://google.com bar http:/twitter.com baz http//google.com'

// Basic
<ReactAutolinker text={text} />

// With options (passes through to Autolinker.js EXCEPT `replaceFn`
const options = {className: 'foo'}
<ReactAutolinker text={text} options={options} />

// With custom tag name for the component (default is div)
<ReactAutolinker text={text} tagName='p' />

// Custom per link render (default implementation shown)
const renderLink = (tag) => React.createElement(tag.tagName, tag.attrs, tag.innerHtml)
<ReactAutolinker text={text} renderLink={renderLink} />

About

React component that wraps Autolinker.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%