1.2.0 • Published 6 years ago

govuk-react-components v1.2.0

Weekly downloads
231
License
MIT
Repository
github
Last release
6 years ago

govuk-react-components

All Contributors

A set of react components to build the basic elements descibed in govuk-elements.

Usage

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.

Using components

Install the package and any dependencies you have:

# Install govuk-react-components
npm install --save govuk-react-components

# This 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:

import React from 'react';
import { Input, Button } from 'govuk-react-components';

const MyForm = () => (
  <form>
    <Input name="name"
           label="First name"
           hint="Some additional information"
           error="Oh no! You broke it!"
           value="HELLO!"
    />
    <Button>Submit</Button>
  </form>
);

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:

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

Contributors

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!

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.8.0

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago