You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know there have already been some issues regarding dynamic attributes, but I want to make this one for my specific case.
I am using maud together with htmx and want to create reusable components.
Given this simple example component I want to add different hx-* attributes to the button depending on where I use it.
Possible solutions would be an Attribute function parameter similar to the Markup type (In this case a list of attributes would also need to be possible)
Have you considered using a match expression to achieve this? Currently there are two ways to use a match to create a reusable component like this. Let's say Attribute is an enum:
Of course both possibilities are more verbose than the solution you are interested in. I just wanted to offer a workaround for your specific issue in case you were not aware how to resolve it.
I know there have already been some issues regarding dynamic attributes, but I want to make this one for my specific case.
I am using maud together with htmx and want to create reusable components.
Given this simple example component I want to add different hx-* attributes to the button depending on where I use it.
Possible solutions would be an
Attribute
function parameter similar to theMarkup
type (In this case a list of attributes would also need to be possible)And/Or an option to add attributes to the root element of the
Markup
type:Syntax for this one may need some tweeking
The text was updated successfully, but these errors were encountered: