/react-dsfr

🇫🇷 DSFR React component library

Primary LanguageTypeScriptMIT LicenseMIT

🇫🇷 French State Design System React integration 🇫🇷

Components documentation - Guides - Playground

👉 Version française du README ici.

WARNING: This Design System is only meant to be used for official French's public service websites and apps.
Its main purpose is to make it easy to identify governmental websites for citizens. See terms.

🗣️ Replay de l'atelier de présentation de la librairie ici.

This module is a wrapper/compatibility layer for @gouvfr/dsfr, the vanilla JS/CSS implementation of the DSFR.

image

While this module is written in TypeScript, using TypeScript in your application is optional (but recommended as it comes with outstanding benefits to both you and your codebase).

This module is a product of Etalab's Free and open source software pole. I'm working full time on this project. You can expect rapid development.

🚀 Get started 🚀

Many of @codegouvfr/react-dsfr's features can be enjoyed without migrating away from @dataesr/react-dsfr.
You can, as standalone feature:

Here is a playground to demonstrate it.

Development

git clone https://github.com/codegouvfr/react-dsfr
cd react-dsfr
yarn

# Starting storybook
yarn storybook

# Starting test apps
yarn start-cra  # For testing in in a Create React App setup
yarn start-vite # For testing in a Vite setup
yarn start-next-pagesdir # For testing in a Next.js 13 PagesDir setup (the default setup)
yarn start-next-appdir # For testing in a Next.js 13 AppDir setup

# Run all unit test (test/runtime):
yarn test
# Run only test/runtime/cssVariable.test.ts (for example)
npx vitest -t "Resolution of CSS variables"

# Debugging while unit testing

Looking to contribute?

Thank you! Here is the contribution guide.

How to publish a new version on NPM, how to release a beta version

This repo was bootstrapped form garronej/ts-ci have a look at the documentation of this starter for understanding the lifecycle of this repo.

Usecases

Projects that uses @codegouvfr/react-dsfr: