@yozora/react-link
v2.0.0-alpha.4
Published
render markdown link in react
Maintainers
Readme
This component is for rendering the Link data produced by
@yozora/tokenizer-link, @yozora/tokenizer-autolink and
@yozora/tokenizer-autolink-extension.
This component has been built into @yozora/react-markdown, you can use it directly.
Install
npm
npm install --save @yozora/react-linkyarn
yarn add @yozora/react-link
Usage
Basic:
import React from 'react' import Link from '@yozora/react-link' import '@yozora/react-link/lib/esm/index.css' const wrapper = ( <Link url="/home" title="home" style={ { color: 'orange', fontSize: '16px' } } > some text1 <span>some text2</span> </Link> )
Props
Name | Type | Required | Default | Description
:----------:|:---------------------:|:---------:|:-------:|:-------------
children | React.ReactNode | false | - | Link contents
className | string | false | - | Root css class
style | React.CSSProperties | false | - | Root css style
title | string | false | - | Link title
url | string | true | - | Link url
className: The root element of this component will always bind with the CSS class'yozora-link'.
