Giter Site home page Giter Site logo

component-articletemplate's Introduction

A template with which to render articles

Goals

  • Stateless.
  • Supports different types of article content.
  • Developed so that article variants with radically-different HTML can co-exist.
  • Separation of styling concerns using variant-specific classes.

Design

An ArticleTemplate is a description of how an ArticleHeader, ArticleSubheader, ArticleBody and ArticleFooter should render a page.

By default it will render a very basic article template, however the use of the higher-order components within component-variantify allow the developer to declaratively specify the different article variants. Both ArticleTemplate and ArticleBodyTemplate can be wrapped to this effect.

All inner components receive a generateClassNameList which can have a class name passed into it so they generate additional variant classes. This function is created from the usage of the higher-order component withVariantClassNameList.

Variant-specific ArticleHeader, ArticleSubheader, ArticleBody and ArticleFooter components can be made with help from some basic components exposed where the default components are defined.

Variants

Usage

See example.es6 for usage instructions.

Install

npm install --save @economist/component-articletemplate;

Run tests

npm test;

component-articletemplate's People

Contributors

sebinsua avatar angelorepole avatar keithamus avatar

Watchers

 avatar 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.