Giter Club home page Giter Club logo

react-components's Introduction

@ukhomeoffice/react-components

A set of react components to build the basic elements described in GOV.UK Design System.

Details

This is a fork of govuk-react-components which replaces the older govuk_frontend_toolkit with the newer govuk-frontend styles based on the GOV.UK Design System, and adds some additional Home Office specific components.

Using components

Authenticate with GitHub packages

Install the package and any dependencies you have:

# Install @ukhomeoffice/react-components
npm install --save @ukhomeoffice/react-components

# This project assumes react & prop-types are installed already. If not use the following
npm install --save @ukhomeoffice/react-components react prop-types

Components can then be used in the following way:

import React from 'react';
import { Input, Button } from '@ukhomeoffice/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;

Examples

There is a basic example app in ./example. To run it:

$ cd example
$ npm start
$ open http://localhost:8080

Publishing

This is automatically published to the GitHub packages npm repository using GitHub Actions.

When opening a pull request add a label major, minor or patch (or skip-release) and the version field in package.json will be updated by the pipeline using npm version.

It is published once the pull request is merged if there is no skip-release label on the pull request, the SHA is also tagged with the SemVer value at that point.

react-components's People

Contributors

lennym avatar joefitter avatar wheelsandcogs avatar dependabot[bot] avatar geemanjs avatar maxosullivan avatar thebailers avatar lvnhmd avatar nickmcmahon01 avatar

Watchers

Ben Marvell avatar Ralph avatar James Cloos avatar  avatar Mark Stringer avatar Mike Thomas avatar Daniel A.C. Martin avatar Liam MacPherson avatar Ben Stevens avatar  avatar Oli Weighell avatar  avatar

Forkers

uk-gov-mirror

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.