Use input/select or toggle buttons to control UI elements
MIT License
Bot releases are hidden (Show)
index.js
moduleswitch-control
value storage works for default-pressed switchesPublished by mirisuzanne about 2 months ago
FIX: switch-control
element now checks for stored values when first connected
Published by mirisuzanne 2 months ago
Published by mirisuzanne 2 months ago
switch-control
elementdata-on
and data-off
attributesonPress()
and onUnPress()
methodsswitch-control.css
providesbutton[is-switch]
,GroundControl
providesinputId
usedValue
getterGroundControl
usedValue
is undefined.GroundControl
providesblockDisplay()
method,display:block
by default.toggle-control
and input-control
switch-control
does not.Published by mirisuzanne 2 months ago
ugh
Published by mirisuzanne 2 months ago
Published by mirisuzanne 3 months ago
Published by mirisuzanne 3 months ago
Published by mirisuzanne 3 months ago
ground-control
base classinput-control
supports basic input
and select
typestoggle-control
supports solo and grouped togglesid="<control-id>"
[optional]:data-for="<selector>"
[defaults to :root
]:data-prop="<css-property-name>"
[optional]:data-attr="<attribute-name>"
[optional]:data-local="<localStorage-key>"
[optional]:localStorage
data-session="<sessionStorage-key>"
[optional]:sessionStorage
data-event="<event-name>"
[optional]:input-control
at this point,change
(the default) or input
data-off="<value>"
[optional]:select
)button
element attributes inside toggle-control
:
data-value
[defaults to the button.innerText
]:aria-pressed
[optional]:output
displays and reset
buttons:
id
of the input
/select
or the toggle-control
…<output for="<control-id>">
:output
as a display for the control<button data-reset="<control-id-list>">
: