Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Pinto allows you to define frontend components using plain PHP classes, simplifying the creation and management of reusable UI elements within Drupal. It integrates smoothly with various Drupal systems like controllers, blocks, and layouts, offering a YAML-free alternative to other component management solutions. Pinto also provides helpers for organizing component files, including PHP, Twig, CSS, and JavaScript.

Pinto is a way of defining frontend components with plain PHP. Define components as simple classes, and let Pinto do the rest. Works well with controller/render-arrays, blocks, layouts, entity displays, etc. No fussing with YAML. Some say its a nicer alternative to SDC. Helpers are provided to replicate a "single directory" setup, wherein PHP, Twig, CSS, JS are colocated.

Pinto Documentation

Example

Component class

namespace Drupal\my_site_ds;

class MyComponent {

  use Drupal\pinto\Object\DrupalInvokableSlotsTrait;

  public function __construct(
    public string $str,
    public int $number,
  ) {
  }
  
}

Template

{{ str }}
{{ number }}

Usage

(new MyComponent(
  str: 'Hello world',
  number: 123,
))();

Project

Pinto has adopted zerover. To inspire confidence, you'll find both the Drupal Pinto project and Pinto PHP library have great test coverage, code coverage, and [level 9 PHPStan] static analysis.

Development of core Pinto features happen on GitHub, while the Drupal integration happens on Drupal.org. Each of these projects are completely independent, while the Drupal integration has a dependency on the library.

See also:

Documentation

Official documentation is available at https://pinto.docs.contrib.social/

Read the blog posts on Pinto:

Activity

Total releases
18
First release
Jan 2025
Latest release
6 months ago
Releases (12 mo)
8 ▼ from 10
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
0.7.0-beta6 Pre-release Dec 22, 2025
0.7.0-beta5 Pre-release Dec 21, 2025
0.7.0-beta4 Pre-release Dec 20, 2025
0.7.0-beta3 Pre-release Dec 19, 2025
0.7.0-beta2 Pre-release Dec 17, 2025
0.7.0-beta1 Pre-release Dec 11, 2025
0.6.0 Stable Nov 6, 2025
0.5.2 Stable Aug 7, 2025
0.5.1 Stable May 4, 2025
0.5.0 Stable Apr 20, 2025
0.4.3 Stable Apr 14, 2025
0.4.2 Stable Apr 9, 2025
0.3.2 Stable Apr 9, 2025
0.4.1 Stable Apr 7, 2025
0.4.0 Stable Apr 5, 2025
0.3.1 Stable Apr 4, 2025
0.3.0 Stable Apr 1, 2025
0.2.2 Stable Jan 31, 2025