Skip to content

[Proposal] Passing other variable values to a snippet #1938

@mnj-novicell

Description

@mnj-novicell

Hi I was wondering if it´s possible to add other variable values to snippet renders?
I find it cumbersome to have to capture a value only to send that value to the snippet. It would be a lot nice if we could be able to add variables into strings, like this example with the button_id.

It would also be great to be able to add translations directly or other filters like capitalize instead of having to capture it.

{% render 'base-button',
  button_id: '{{ id }}-trigger',
  button_aria_label: 'general.my_translation' | t
%}

If it´s already possible and I´m just using the wrong syntax, that would be great to know, otherwise it would be a nice upgrade for the developer experience.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions