JSPM

hovertile

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q24686F
  • License MIT

A port of Mary Lou's hover tiles to React

Package Exports

  • hovertile

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hovertile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

HoverTiles

A port of Mary Lou's hover tiles to React

Uses composable components to allow extensive customization inside components.

Usage

Hover Tiles is intended for use as a react component. Required environment includes:

- ES6 (Webpack/Babel)
- Stlye Loader (Webpack resource loader)

Install:

npm install hovertile

Use:

//Import

import React, {Component, PropTypes} from "react";

import Apollo from "components/HoverTile/Apollo";

import TileContent from "components/HoverTile/Content";
import TileHoverContent from "components/HoverTile/HoverContent";
import TileClickbox from "components/HoverTile/Clickbox";
import TileBackground from "components/HoverTile/Background";

//Use as a normal react component
class YourComponent extends React {
    render() {
        return (
            <Apollo>
                <TileBackground><img src="/image/source"/></TileBackground>
                <TileContent>Default content</TileContent>
                <TileHoverContent>Content that shows upon hover</TileHoverContent>
                <TileClickbox><a>Clickbox over the whole tile</a></TileClickbox>
            </Apollo>
        );
    }
}

//Image shortcut
class YourComponent extends React {
    render() {
        return (
            <Apollo image="/image/source">
                <TileContent>Default content</TileContent>
                <TileHoverContent>Content that shows upon hover</TileHoverContent>
                <TileClickbox><a>Clickbox over the whole tile</a></TileClickbox>
            </Apollo>
        );
    }
}

Example

See example react project at HoverTiles-Example