GithubHelp home page GithubHelp logo

happy-ferret / react-user-card Goto Github PK

View Code? Open in Web Editor NEW

This project forked from darthlukan/react-user-card

0.0 2.0 0.0 284 KB

A user card heavily inspired by Google's Material Design concept written as a ReactJS component.

License: MIT License

JavaScript 100.00%

react-user-card's Introduction

react-user-card

Author: Brian Tomlinson [email protected]

Description

A user card heavily inspired by Google's Material Design written as a ReactJS component.

TODO

  • Package for NPM/Bower/whatever the JS users are using nowadays
  • Optional color params for title background and title font
  • Fix CSS inclusion, copying files from installation paths is janky
  • Better behavior on mobile screens, current media queries aren't really good enough
  • Cleanups

Screenshot

Imgur

Usage

The card supports optional css object parameters as shown in the example below:

    var React = require('react');
    var Card = React.createFactory(require('react-user-card'));

    var cardStl = {
        backgroundColor: '#fafafa',
        width: '30%',
        height: '20%',
        overflow: 'hidden',
        boxShadow: '.25px .25px 5px .25px',
        borderRadius: '2px 2px 2px 2px',
        zIndex: 5
    };

    var headerStl = {
        backgroundColor: '#901111', // red
        padding: '1%',
        color: '#eceff1',
        position: 'relative'
    };

    var contentStl = {
        color: 'rgb(0, 0, 0, 0.54)',
        padding: '2%'
    };


    React.render(
        Card(
            {
                userimg: 'http://www.gravatar.com/avatar/6a8561ee5706d17a4382a391720db523.png', 
                username: 'DarthLukan', 
                content: 'Dark Lord of the Sith.',
                cardStyle: cardStl,
                headerStyle: headerStl,
                contentStyle: contentStl
            }
        ), document.getElementById('app')
    );

Calling the card with the example code above will render a card that looks like:

Imgur

NOTE: Omitting the cardStyle, headerStyle, and contentStyle parameters will render the same as the one in the "Screenshots" section of the README.

License

MIT, see LICENSE file

react-user-card's People

Contributors

darthlukan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.