This module automatically declares components from the French State Design System (DSFR) as Drupal libraries.

Features

If you need to use a component, you can attach it to your render array like this:

$build['#attached']['library'][] = 'dsfr_libraries/checkbox';

Or declare it as a dependency of your own library:

  dependencies:
    - dsfr_libraries/checkbox

The JS and CSS from this component will then be included in the page.

Additional Requirements

The dsfr needs to be installed in web/libraries/dsfr/.

For example, you can use Asset Packagist to install it with Composer:

{
    "require": {
        "npm-asset/gouvfr--dsfr": "^1.12"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    ],
    "extra": {
        "installer-paths": {
            "web/libraries/dsfr": [
                "npm-asset/gouvfr--dsfr"
            ]
        },
        "installer-types": [
            "npm-asset"
        ]
    }
}
Supporting organizations: 

Project information

Releases