0.1.4 • Published 3 years ago

@innofake/b0t-switch v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

b0t-switch

A control that allows a user to switch a value on or off.

Installation

npm install @innofake/b0t-switch

Example

<b0t-switch
  label="My Switch Value"
  data="{'id': 12345, 'name': 'Test'}"
  hint="Required"
  error="Field level error message"
  checked>
</b0t-switch>

Properties

PropertyAttributeModifiersTypeDefaultDescription
checkedcheckedbooleanfalseIndicator if the component is checked or not.
datadataObjectData associated with the component.
disableddisabledbooleanfalseIndicator if the component is disabled.
errorerrorstringAn error message to guide users to correct a mistake.
hinthintstringA hint message to assist the user.
labellabelstringThe switch label text.
overrideThe element style template.
stylesreadonlyCSSResult[]

Methods

MethodType
focus(): void

Events

EventTypeDescription
value-changeCustomEvent<{ old: Boolean; new: Boolean; }>Dispatched when the switch checked state is changed.
value-changedCustomEvent<{ old: Boolean; new: Boolean; }>Dispatched when the switch checked state is changed.

CSS Custom Properties

PropertyDescription
--innofake-b0t-switch-checked-hover-knob-box-shadowKnob checked hover box shadow.
--innofake-b0t-switch-checked-knob-background-colorKnob checked background color.
--innofake-b0t-switch-checked-track-background-colorTrack checked background color.
--innofake-b0t-switch-disabled-knob-background-colorKnob disabled background color.
--innofake-b0t-switch-disabled-knob-box-shadowKnob disabled hover box shadow.
--innofake-b0t-switch-disabled-track-background-colorTrack disabled background color.
--innofake-b0t-switch-input-error-label-font-colorError text font color.
--innofake-b0t-switch-input-error-label-font-familyError text font family.
--innofake-b0t-switch-input-error-label-font-sizeError text font size.
--innofake-b0t-switch-input-error-label-font-weightError text font weight.
--innofake-b0t-switch-input-hint-label-font-colorHint text font color.
--innofake-b0t-switch-input-hint-label-font-familyHint text font family.
--innofake-b0t-switch-input-hint-label-font-sizeHint text font size.
--innofake-b0t-switch-input-hint-label-font-weightHint text font weight.
--innofake-b0t-switch-knob-background-colorKnob background color.
--innofake-b0t-switch-knob-box-shadowKnob box shadow.
--innofake-b0t-switch-knob-heightKnob height.
--innofake-b0t-switch-knob-hover-box-shadowKnob hover box shadow.
--innofake-b0t-switch-knob-widthKnob width.
--innofake-b0t-switch-label-font-colorLabel font color.
--innofake-b0t-switch-label-font-familyLabel font family.
--innofake-b0t-switch-label-font-sizeLabel font size.
--innofake-b0t-switch-label-font-weightLabel font weight.
--innofake-b0t-switch-label-spacingLabel left margin spacing.
--innofake-b0t-switch-track-background-colorTrack background color.
--innofake-b0t-switch-track-border-radiusTrack border radius.
--innofake-b0t-switch-track-heightTrack height.
--innofake-b0t-switch-track-insetTrack inset margins.
--innofake-b0t-switch-track-widthTrack width.
0.1.4-esm

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.0.34

3 years ago

0.0.33

3 years ago

0.0.32

3 years ago

0.0.31

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.18

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.6

3 years ago