1.0.8 • Published 5 years ago

react-ui-flex-cards v1.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

react-flex-ui-cards

Humble and quick custom variations on react-ui-cards by @nukeop with a little help from react-player by @CookPete - for a blog project. Planning to contribute to react-ui-cards where applicable, but contributions here are definitely welcome.

Basic additions were border-radius, predetermined widths, a "navigation" card, a video card, a figure card (photo or diagram with white-background text instead of overlay).

Suggested changes to the original package will most likely entail making more props available on the existing components to build the ones I've added here, for dryness and clarity.

npm

https://www.npmjs.com/package/react-flex-ui-cards

Installation

$ yarn add react-ui-flex-cards
$ npm install --save react-ui-flex-cards

Development

Getting started

After cloning the repo, run the following commands to start the project in development mode with hot reload:

$ yarn
$ yarn run dev

Card types

Video card (added)

Video player using react player library, tested with YouTube and Vimeo sources https://www.npmjs.com/package/react-player

attributetypedescription
srcstringValid video content url
widthstringcss width value
heightstringcss height value

Nav cards

Sticky user-based nav bars with menu option and collapsing banner image and avatar on scroll

attributetypedescription
avatarstringurl of user image
cardClassstring'banner' or 'wide'
headerstringurl of header background
githubUrlstringa short description of the product
twitterUrlintegerrating of the product (0-5). Not implemented yet.
linkedInUrlstringurl the 'buy now' button will link to
menuarray of objectsname and url keys as strings

Usage:

div style={{ position: 'sticky', top: '10px', zIndex: 33 }}>
        <NavCard
          githubUrl='https://github.com/dfrho'
          twitterUrl='https://twitter.com/rhodesdav'
          linkedInUrl='https://www.linkedin.com/in/rhodesdavid'
          cardClass='card banner'
          header='https://i.imgur.com/w5tX1Pn.jpg'
          avatar='https://i.imgur.com/uDYejhJ.jpg'
          name='Justin Case'
          positionName='Software Developer'
          menu={[
            {
              name: 'home',
              route: '/'
            },
            {
              name: 'blog',
              route: '/blog'
            },
            {
              name: 'projects',
              route: '/projects'
            }
          ]}
        />
      </div>

User cards

Cards representing users or people with the addition of a social icon bar instead of stats (followers, etc.)

attributetypedescription
cardClassstringadditional CSS classes you might want to apply to the Card. Putting 'float' here will enable an on-hover animation. 'banner' is 750px max width, 'block' is 350px width
hrefstring/nulloptional url the card will link to when clicked
headerstringurl to the image that will be displayed in the upper part of the card
avatarstringurl to the image that will be displayed in the center of the card
namestringuser's name
positionNamestringuser's role
twitterUrlstringoptional url of user twitter feed
linkdInUrlstringoptional url of user LinkdIn feed
githubUrlstringoptional url of user github feed

Product cards

Cards representing products available for purchase.

attributetypedescription
photosarrayarray of urls to photos of the product
pricestringthe price that will be displayed in the upper lefthand corner
productNamestringname of the product
descriptionstringa short description of the product
ratingintegerrating of the product (0-5). Not implemented yet.
urlstringurl the 'buy now' button will link to
className (added)string'banner', and 'block' signifying widths

News header card

Cards you can use on the news site, shows the title, author and date it was published. Click on image to see the exact news.

attributetypedescription
hrefstring/nulloptional url the card will link to when clicked
thumbnailstringurl to the image that will be displayed in the background
authorstringauthor of aricle linked in href
datestringdate of publishing
className (added)string'roadblock', 'banner', and 'block' signifying widths