Skip to content

Add wcProp factory for web component property binding#469

Open
Piyush-t24 wants to merge 1 commit intoarmanbilge:mainfrom
Piyush-t24:feature/html-wc-prop
Open

Add wcProp factory for web component property binding#469
Piyush-t24 wants to merge 1 commit intoarmanbilge:mainfrom
Piyush-t24:feature/html-wc-prop

Conversation

@Piyush-t24
Copy link
Copy Markdown

Web components expose their API through JS properties (el.value, el.disabled)
not HTML attributes, so setAttribute doesn't work for them.

Calico already has Prop[F,V,J] with all the right machinery, but there was no
public way to create one for an arbitrary property name outside of generated code.

This adds two methods to Html[F]:

def wcProp[V](name: String): Prop[F, V, V]
def wcProp[V, J](name: String, encode: V => J): Prop[F, V, J]

All existing Prop forms work automatically — :=, <--, Signal, Option variants.

Related to #37.

@Piyush-t24 Piyush-t24 force-pushed the feature/html-wc-prop branch from 25c91f5 to 0fbf956 Compare March 29, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant