πŸ”§Initial setup

Setup @codegouvfr/react-dsfr in your project or start from a template

Demo setup in production here: https://react-dsfr-vite-demo.vercel.app/

If you want a more complete starter with a Ready yo use stack that includes routing, autentication, internationalisation ect. you can also use this starter instead:

It's live here: https://vite-insee-starter.demo-domain.ovh/

Using Nx monorepo? See this.

Add these three scripts to your package.json:

Trigger the execution of the postinstall script by running:

Add the following tags in the <head />

You're all set! Next step for you is to setup the integration with your routing library (react-router for example).

πŸ”€Integration with routing libs

Avoiding or flash of unstyled text (FOUT)

You can avoid having a flash of unstyled text by preloading the font variant used on your homepage (look in the network tab of your browser dev tools what are the font downloaded initially).

Add the following tags in the <head />

Last updated

Was this helpful?