Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

canvas_focal_point_widget

7 sites No security coverage
View on drupal.org

Widget to set focal point and image scale within canvas editor interface.

I have used the great Focal Point module in the past however that module set the focal point globally for an image. Also the focal point is set at generation and editing of the media entity. I wanted the ability to set focal point per instance in Canvas interface. For example, the same media entity is used on a hero component with a specific focal point and then used in a card with a different focal point.

*Work in Progress and generated with the help of AI*

Features

Provides a visual focal point picker and image scale slider for
Canvas component image props.

- Drag-and-drop focal point dot overlaid on a live image thumbnail
- Optional scale slider (100–200 %) when a `{prefix}_scale` prop is present
- Auto-discovers any prop pair following the `{prefix}_focal_x` /
`{prefix}_focal_y` naming convention — no per-component configuration needed

Example props:

media_focal_x:
      type: number
      title: Image Focal Point X (%)
      description: Horizontal focal point as a percentage (0 = left, 50 = center, 100 = right).
      default: 50
      minimum: 0
      maximum: 100
      examples:
        - 50
media_focal_y:
      type: number
      title: Image Focal Point Y (%)
      description: Vertical focal point as a percentage (0 = top, 50 = center, 100 = bottom).
      default: 50
      minimum: 0
      maximum: 100
      examples:
        - 50
media_scale:
      type: number
      title: Image Scale (%)
      description: Scale the image within its container (100 = fit, 200 = 2× zoom).
      default: 100
      minimum: 100
      maximum: 200
      examples:
        - 100

Corresponding example twig

{% set media_img_style = 'object-fit:cover;object-position:' ~ focal_x ~ '% ' ~ focal_y ~ '%;transform:scale(' ~ scale_css ~ ');transform-origin:' ~ focal_x ~ '% ' ~ focal_y ~ '%' %}

      {% block media %}
        <img
          src="{{ media.src }}"
          alt="{{ media.alt|default('') }}"
          class="absolute inset-0 h-full w-full"
          style="{{ media_img_style }}"
          width="{{ media.width }}"
          height="{{ media.height }}"
          loading="lazy"
        />
      {% endblock %}

Additional Requirements

- Drupal 11 or later
- Canvas module

Similar projects

Focal Point sets the focal point globally for an image. Also the focal point is set at generation and editing of the media entity. Canvas Focal Point Widget sets the focal point per media instance in Canvas editor interface.

Activity

Total releases
2
First release
Apr 2026
Latest release
1 month ago
Release cadence
1 day
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Apr 20, 2026
1.0.x-dev Dev Apr 19, 2026