@yozora/react-image
This component is for rendering the Image data produced by
@yozora/tokenizer-image.
This component has been built into @yozora/react-markdown, you can use it directly.
Install
-
npm
npm install --save @yozora/react-image
-
yarn
yarn add @yozora/react-image
Usage
-
Basic:
import React from 'react' import Image from '@yozora/react-image' import '@yozora/react-image/lib/esm/index.css' const wrapper = (<Image src="https://avatars.githubusercontent.com/u/42513619" />)
Props
Name | Type | Required | Default | Description |
---|---|---|---|---|
alt |
string |
false |
#src |
Image alt |
className |
string |
false |
- | Root css class |
src |
string |
true |
- | Image src |
style |
React.CSSProperties |
false |
- | Root css style |
title |
string |
false |
- | Image title |
-
className
: The root element of this component will always bind with the CSS class'yozora-image'
.