1.0.7 • Published 4 years ago

@jswork/react-image-icon v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

react-image-icon

Image icon for react.

version license size download

installation

npm install -S @jswork/react-image-icon

properties

NameTypeRequiredDefaultDescription
classNamestringfalse-The extended className for component.
disabledboolfalse-If show disabled.
valueanyfalse-The icon image src.
sizeunionfalse40Image icon width/height.

usage

  1. 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: ()
  2. 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.

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago