@economist/component-articletemplate

8.1.3 • Public • Published

component-articletemplate

A template with which to render articles

Goals

  • [x] Stateless.
  • [x] Supports different types of article content.
  • [x] Developed so that article variants with radically-different HTML can co-exist.
  • [x] 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;

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
8.1.31latest

Version History

VersionDownloads (Last 7 Days)Published
8.1.31
8.1.21
8.1.11
8.1.01
8.0.11
8.0.01
7.0.21
7.0.10
7.0.00
6.3.20
6.3.10
6.3.00
6.2.30
6.2.20
6.2.10
6.2.00
6.1.00
6.0.10
6.0.00
5.1.09
5.0.40
5.0.30
5.0.20
5.0.10
5.0.00
4.6.30
4.6.29
4.6.19
4.6.09
4.5.19
4.5.09
4.4.09
4.3.00
4.2.20
4.2.10
4.2.09
4.1.30
4.1.29
4.1.10
4.1.00
4.0.10
4.0.00
3.0.10
3.0.00
2.1.00
2.0.20
2.0.10
2.0.00
1.0.10

Package Sidebar

Install

npm i @economist/component-articletemplate

Weekly Downloads

88

Version

8.1.3

License

MIT

Last publish

Collaborators

  • wellingtonvieira
  • economist-org-bot