npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ukhomeoffice/cop-react-form-renderer

v8.0.1

Published

The COP React Form Renderer is a library that renders a form on the basis of a supplied JSON.

Readme

cop-react-form-renderer

The COP React Form Renderer is a library that renders a form on the basis of a supplied JSON.

It uses components from COP React Design System.

  • @ukhomeoffice/cop-react-components - and offers various styles of forms. These are showcased inside of a npm run storybook within the project.

To get started run nvm use to switch to currently supported node version (if your using node version manager). Otherwise, install node version specified in .nvmrc.

This project is essentially 2 packaged into one repo:

  • A library of React components with unit tests defined for reuse by other repos (see /src/stories)
  • A React Storybook application with documentation for each React component (see .stories.tsx files)

The library of components is transpiled (and is cleaned up by rimraf). The storybook can be useful for developers and web designers to provide context for each component.

Available Scripts

In the project directory, you can run:

npm install

Installs the package.json dependencies.

npm run storybook

Runs the app in the development mode.
Open http://localhost:6006 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

You can also use npm test:coverage to see the % code coverage for the repo.

npm run lib:transpile

Builds the components for production to the dist folder.
It correctly bundles React components in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your components are ready to be deployed!

npm run build-storybook

Builds the storybook files ending in .stories.tsx to static HTML, CSS & JS files located in storybook-static folder.

npm run lib:yalc-publish

This will compile the code with source maps enabled and publish it to the local yalc repository in ~/.yalc (%LOCALAPPDATA%/Yalc on Windows).

To use in another repo, use yalc add @ukhomeoffice/[email protected] (with your version number) To remove previous yalc versions, run within the other repo: yalc remove --all

Be weary that other dependencies using Vite or similar may cache the unchanged version of the module (instead of the auto-updating Yalc version) inside the node_modules of the project you're testing from

Learn More

You can learn more in the Introduction to Storybook for React.

To learn React, check out the React documentation.

Using the Service

Versioning

For versioning this project uses SemVer.

Deploying Storybook

Storybook changes will be deployed automatically on merge to main, see deploy-storybook.yml or can alternatively be triggered manually via github actions ui for branch deployments.

The ui is available here.

Authors

This project is authored by the Home Office.

License

This project is licensed under the MIT license. For details please see License.

This project contains public sector information licensed under the Open Government Licence v3.0. (http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])