apeman-react-head
apeman react package for head component.
Last updated 3 years ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apeman-react-head 
SYNC missed versions from official npm registry.

apeman-react-head

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for head component.

Installation

$ npm install apeman-react-head --save

Usage

Render head tag with meta tags.

'use strict'

import React from 'react'
import {ApHead} from 'apeman-react-head'

const ExampleComponent = React.createClass({
  render() {
    return (
      <html>
      <ApHead charset="utf-8"
              title='foo'
              icon='./favicon.png'
              meta={ {'description': 'This is description.'} }
              version='1.0.0'
              css={ ['css/lib.css', 'css/app.css'] }
              js={ ['js/lib.js', 'js/app.js'] }
              globals={ {
                appProps: {/* ... */}
            } }
      >
        <meta name="example-child-elm"/>
      </ApHead>
      <body>
      </body>
      </html>
    )
  }
})

Results like:

<!DOCTYPE html>
<html>
<head class="ap-head">
    <meta class="ap-head-meta" charset="utf-8"/>
    <title class="ap-head-title">foo</title>
    <meta name="description" content="This is description."/>
    <link rel="icon" href="./favicon.png?v=1.0.0"/>
    <script type="text/js" src="js/lib.js?v=1.0.0"></script>
    <script type="text/js" src="js/app.js?v=1.0.0"></script>
    <link rel="stylesheet" type="text/css" href="css/lib.css?v=1.0.0"/>
    <link rel="stylesheet" type="text/css" href="css/app.css?v=1.0.0"/>

    <meta name="example-child-elm"/>
</head>
</html>

Components

ApHead

Props

Name Type Default Description
charSet string 'utf-8'
title string
icon string
meta arrayOf object
itemProps arrayOf object
css array
js array
version string 'unknown'
versionKey string 'v'
globals object
viewPort object {

width: 'device-width', initialScale: '1.0' } | | View port settings | | base | string | null | | Base url | | baseTarget | string | undefined | | Target of base url. '_blank', '_parent', '_self', '_top' or frame name | | manifest | string | | | Path of manifest.json | | color | string | | | Theme color |

Props

Name Type Default Description
charset string null Charset value.
title string null Title value.
icon string null Favicon file path.
meta object null Meta values.
css array null Css file urls.
js array null Js file urls.
version string 'unknown' Version number.
versionKey string 'v' Key of version in query string.

License

This software is released under the MIT License.

Links

Current Tags

  • 3.2.0                                ...           latest (3 years ago)

29 Versions

  • 3.2.0                                ...           3 years ago
  • 3.1.7                                ...           4 years ago
  • 3.1.6                                ...           4 years ago
  • 3.1.5                                ...           4 years ago
  • 3.1.4                                ...           4 years ago
  • 3.1.3                                ...           4 years ago
  • 3.1.2                                ...           4 years ago
  • 3.1.1                                ...           4 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.10                                ...           4 years ago
  • 3.0.6                                ...           4 years ago
  • 3.0.5                                ...           4 years ago
  • 3.0.4                                ...           4 years ago
  • 3.0.3                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.5                                ...           4 years ago
  • 2.1.4                                ...           4 years ago
  • 2.1.3                                ...           5 years ago
  • 2.1.2                                ...           5 years ago
  • 2.1.1                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 58
Dependencies (2)
Dev Dependencies (27)

Copyright 2014 - 2017 © taobao.org |