React components for govuk layouts and elements
npm install govuk-react-componentsA set of react components to build the basic elements descibed in govuk-elements.
This is very Work In Progress code at the moment so you almost certainly don't want it anywhere near production right now.
Contributions are welcome.
bash
Install govuk-react-components
npm install --save govuk-react-componentsThis project assumes react & prop-types are installed already. If not use the following
npm install --save govuk-react-components react prop-types
`Components can then be used in the following way:
`jsx
import React from 'react';
import { Input, Button } from 'govuk-react-components';const MyForm = () => (
);export default MyForm;
`Loading assets
To include the necessary stylesheets and assets in your nodejs app you can - if you are using express - mount the included middleware to serve these files:
`js
app.use(require('govuk-react-components/middleware').assets());
`Examples
There is a basic example app in
./example. To run it:`
$ cd example
$ npm start
$ open http://localhost:8080
``Thanks goes to these wonderful people (emoji key):
|
Leonard Martin
💬 💻 📖 💡 🤔 👀 ⚠️ |
James Gee
💬 💻 📖 💡 🤔 👀 ⚠️ |
Simon Bailey
💻 ⚠️ |
| :---: | :---: | :---: |
This project follows the all-contributors specification. Contributions of any kind welcome!