Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Pinto: Native Components

Security covered Under active development 36 sites

Part of the Pinto ecosystem · 5 projects

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:

Drupal 10–11

Ask your assistant about Pinto: Native Components

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

3 tracked projects depend on this one

More in the Pinto ecosystem

Most installed first

All 5 →

Activity

Tracked releases
30
Tracked since
Mar 2024
Latest release
9 months ago
Releases (12 mo)
7 ▼ from 14
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
0.1.1 Stable 10–11 Oct 23, 2024
0.1.0 Stable 10–11 PHP 8.2 Sep 12, 2024
0.0.7 Stable 10 PHP 8.2 May 31, 2024
0.0.6 Stable 10 PHP 8.2 Mar 14, 2024
0.0.5 Stable 10 PHP 8.2 Mar 14, 2024
0.0.4 Stable 10 PHP 8.2 Mar 14, 2024
0.0.3 Stable 10 PHP 8.2 Mar 14, 2024
0.0.2 Stable 10 PHP 8.2 Mar 6, 2024
0.0.1 Stable 10 PHP 8.2 Mar 5, 2024
1.x-dev Dev 10–11 PHP 8.2 Mar 5, 2024