1.0.7 • Published 4 years ago
@jswork/react-image-icon v1.0.7
react-image-icon
Image icon for react.
installation
npm install -S @jswork/react-image-icon
properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | - | The extended className for component. |
disabled | bool | false | - | If show disabled. |
value | any | false | - | The icon image src. |
size | union | false | 40 | Image icon width/height. |
usage
import css
@import "~@jswork/boilerplate-react-component/dist/style.css"; // or use sass @import "~@jswork/boilerplate-react-component/dist/style.scss"; // customize your styles: $boilerplate-react-component-options: ()
import js
import React from 'react'; import ReactImageIcon from '@jswork/react-image-icon'; import styled from 'styled-components'; import '../../src/components/style.scss'; const Container = styled.div` width: 80%; margin: 30px auto 0; `; export default (props: any) => { return ( <Container> <ReactImageIcon size={32} value="https://tva1.sinaimg.cn/large/007S8ZIlgy1gexw87htqhj305k05k74o.jpg" /> <ReactImageIcon value={{ normal: 'https://mat1.gtimg.com/v/comment/images/avatar_default.9d95c455.jpg', hover: 'https://tva1.sinaimg.cn/large/007S8ZIlgy1gexw87htqhj305k05k74o.jpg' }} /> </Container> ); };
license
Code released under the MIT license.