Skip to content

Conditional attributes #134

Open
Open
@tonyarnold

Description

@tonyarnold

In HTML, there are attributes that we'd only want to add on some condition, such as "checked" and "disabled". This is currently quite verbose to do, involving something like:

if someCondition {
  Input()
    .checked()
} else {
  Input()
}

It would be really helpful if there were support for something like:

Input()
  .checked(when: someCondition)
  .disabled(when: someConditition)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions