Switch
Takes an input of type checkbox and uses it to change any target prop of any element.
- class
- Switch
- extends
- Set
- tag
<switch-blam>
Props
| name | type | default | description |
|---|---|---|---|
| event | string | input | Do not supply an |
| value | string | null | If a |
| reverse | false | Whether to reverse the polarity of the checked state. Useful where the label and prop seem to contradict one another. For example, a switch labeled “filter” that turns a filter on by making its bypass property |
|
| ramp | number | In beats. Where the |
|
| revert | boolean | false | When |
| once | boolean | false | Whether to only handle the event one time. Interesting, compositionally, when paired with a low |
| from | string | A CSS selector representing all elements from which events will be listened to. If not set, the node array defaults to the element’s |
|
| to | string | A CSS selector representing all elements to affect in response to the event. If not set, the node array defaults to the element’s |
|
| prop | string | null | The property (which may be a method or map to an |
| bypass | boolean | false | Whether to stop responding to events as they happen. |
| chance | boolean | 1 | The probability that the |
Examples
Examples that use the Switch element: