🇫🇷 French State Design System React toolkit 🇫🇷
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.
Its main purpose is to make it easy to identify governmental websites for citizens. See terms.
This module is an advanced toolkit that leverages @gouvfr/dsfr, the vanilla JS/CSS implementation of the DSFR.
![image](https://user-images.githubusercontent.com/6702424/224423044-c1823249-eab6-4844-af43-d059c01416af.png)
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).
- Fully TypeSafe, well documented API.
- Always in up to date with latest the DSFR evolutions.
Code and Types generated from
@gouvfr/dsfr
/dist/dsfr.css
. - Exactly the same look and feel than with @gouvfr/dsfr.
- No white flash when reloading in SSR setup.
- Most components are server component ready. The others are labeled with
"use client";
- Perfect integration with all major React framework: Next.js (PagesDir and AppDir), Create React App, Vite.
- (Almost) All the components are implemented
- Three shakable distribution, cherry pick the components you import. (It's not all in a big .js bundle)
- Optional integration with MUI. If you use MUI components they will be automatically adapted to look like DSFR components. See documentation.
- Enable the usage of CSS in JS solutions. Doc.
- Opt-in i18n, built in text can be displayed in multiple languages and user can provide extra translations.
- Support routing libraries like react-router.
💡 Need ready to use, DSFR compliant login and register pages? Checkout keycloak-theme-dsfr.
This module is a product of Etalab's Free and open source software pole.
This project is co-maintained by public servants from various French administrations:
- Joseph Garrone - Insee
- Julien Bouquillon - DNUM des ministères sociaux
- Dylan DECRULLE - Insee
- Enguerran Weiss - Plateforme de l'Inclusion
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 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"
Thank you! See the contribution guide.
This repo was bootstrapped form garronej/ts-ci have a look at the documentation of this starter for understanding the lifecycle of this repo.
A few projects that use @codegouvfr/react-dsfr
.
- https://code.gouv.fr/sill
- https://cartes.gouv.fr
- https://immersion-facile.beta.gouv.fr/
- https://egapro.travail.gouv.fr/
- https://maisondelautisme.gouv.fr/
- https://refugies.info/fr
- https://www.mediateur-public.fr/
- https://signal.conso.gouv.fr/
- https://observatoire.numerique.gouv.fr/
- https://github.com/BaseAdresseNationale/adresse.data.gouv.fr
- https://github.com/DISIC/observatoire.numerique.gouv.fr
- https://github.com/DISIC/monfranceconnect
- https://github.com/InseeFr/Lunatic-DSFR
- https://github.com/EIG6-Geocommuns/lidarviz-front
- https://github.com/EIG6-Geocommuns/geocommuns-core
- https://github.com/SocialGouv/bpco-site
- https://github.com/EIG6-ArtificIA/predictia_front
- https://github.com/BaseAdresseNationale/bal-admin
- https://github.com/etalab/sill-web
- https://github.com/inclusion-numerique/mediature
- https://territoiresentransitions.fr (maybe)
- https://potentiel.beta.gouv.fr
- https://diagoriente.beta.gouv.fr