Skip to content

Conditional attributes #134

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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