New York State Design System Libraries
This module provides Drupal library support for New York State Design System components within traditional theme-based frontends. It makes NYS Design System components available for use directly in your Drupal site's templates.
New York State Design System Libraries provides Drupal library support for NYS Design System components in sites using a traditional theme-based frontend. It is not intended for detached frontends or SPAs; for those, include the NYSDS library directly in your project.
For a full description of the module, visit the project page or the module's expanded documentation page.
Submit bug reports and feature suggestions, or track changes in the issue queue.
Requirements
There are no additional module or library dependencies. The NYS Design System library is included fully built at a specific version inside the module itself (see Installation below).
Installation
Install as a normal contributed Drupal module. For further information, see: Installing Drupal Modules.
This project is versioned to match a specific NYSDS release. We recommend installing the version of this module that corresponds to the version of NYSDS you need. Avoid using ^ or ~ in your composer constraints so upgrades remain deliberate and reviewable.
After installation, add this module as a dependency for any theme or module that will use NYSDS components. This is not required for Drupal to register the components, but it is recommended for clarity and dependency management.
Configuration
No active configuration is required. The module uses Drupal's built-in component registration system to provide template references for NYSDS components.
Usage
Example using the alert component in a Twig template:
{% set alertTypeLabel = fields.field_alert_type.content %}
{% if alertTypeLabel == 'Warning' %}
{% set alertType = 'danger' %}
{% set alertIcon = 'warning' %}
{% elseif alertTypeLabel == 'Information' %}
{% set alertType = 'warning' %}
{% set alertIcon = 'info' %}
{% endif %}
{% set alertLabel = fields.field_alert_label.content %}
{% include 'nys_ds:alert' with {
type: alertType,
icon: alertIcon,
heading: alertLabel,
text: fields.field_alert_message.content,
primaryLabel: alertTypeLabel
} %}
Whenever a property requires rendered HTML, it's always best to pass it a render array or a twig block as follows:
{% set customContentBlock %}
My variable: {% myVariable %}
{% endset %}
For much more expanded and detailed usage guidance, including webform components, see our expanded documentation.
Example site
This repository includes an example site configured with DDEV. Use it to explore how NYSDS components are applied in a Drupal context.
For more information, see our expanded documentation for the example site.
Maintainers
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.20.0-beta1 | Pre-release | 11 | NYSDS 1.20.0 | Aug 25, 2026 | |
| 1.19.4-beta1 | Pre-release | 11 | Jul 28, 2026 | ||
| 1.17.0-beta4 | Pre-release | 11 | Jun 24, 2026 | ||
| 1.17.0-beta3 | Pre-release | 11 | Jun 12, 2026 | ||
| 1.17.0-beta2 | Pre-release | 11 | Slotted prop display fix. | Jun 9, 2026 | |
| 1.17.0-beta1 | Pre-release | 11 | Jun 4, 2026 | ||
| 1.16.1-alpha1 | Pre-release | 11 | May 7, 2026 | ||
| 1.15.1-alpha1 | Pre-release | 11 | Initial release | Apr 15, 2026 | |
| 1.0.x-dev | Dev | 11 | Initial release | Mar 11, 2026 |