1.0.23 • Published 8 years ago

fdmg-ts-react-image-button v1.0.23

Weekly downloads
32
License
ISC
Repository
github
Last release
8 years ago

Build Status Coverage Status

npm version

fdmg-ts-react-image-button

ReactJS ImageButton component. This component renders an image with onClick hook.

Installation

  • Run npm i --save-dev fdmg-ts-react-image-button

or

  • Run yarn add fdmg-ts-react-image-button --dev

Usage

TypeScript

import * as React from 'react';
import ImageButton from 'fdmg-ts-react-image-button';

export default class foo {
    public state: any;
    public props: any;

    constructor(props: any) {
        super(props);
        this.props = props;
    }

    clickHandler() {
        console.info('Image button clicked');
    }

    render() {
        return (
            <ImageButton
                src={"img/button.svg"} 
                onClick={this.clickHandler.bind(this)}
                className="image-btn btn"
                alt="Special button"
            />
        );
    }
}

Resulting HTML

<span class="image-btn btn"
      role="button"
      tabIndex="0"
      aria-label="Special button">
    <img alt="Special button" src="img/button.svg"/>
</span>
1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago