0.1.4 • Published 2 years ago

@innofake/b0t-switch v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.0

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.18

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.6

2 years ago