1.0.6 • Published 10 months ago

@maggioli-design-system/mds-input-switch v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

mds-input-switch

This is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.

Properties

PropertyAttributeDescriptionTypeDefault
autofocusautofocusSets or returns whether a checkbox should automatically get focus when the page loadsbooleanundefined
checkedcheckedSpecifies that an element should be pre-selected when the page loads (for type="checkbox" or type="radio")boolean \| undefinedundefined
disableddisabledSets or returns whether a checkbox is disabled, or notboolean \| undefinedundefined
explicitexplicitSets if the type switch mode shows explicit iconsboolean \| undefinedundefined
iconiconThe checked icon displayedstring''
indeterminateindeterminateSets or returns the indeterminate state of the checkboxbooleanfalse
namenameSpecifies the name of an elementstring''
sizesizeSpecifies the size for the switch toggle, it works only if attribute 'type' is set to 'switch'"lg" \| "md" \| "sm"'md'
typetypeSpecifies switch type: switch (default), checkbox and radio"checkbox" \| "radio" \| "switch"'switch'
typographytypographySpecifies the font typography of the element"caption" \| "detail" \| "label" \| "option" \| "paragraph" \| "tip" \| undefined'detail'
valuevalueSpecifies the value of the input elementstring \| undefined''
variantvariantSpecifies the variant for typography"code" \| "info" \| "read" \| "title" \| undefinedundefined

Events

EventDescriptionType
mdsInputSwitchChangeEmits when the value changesCustomEvent<MdsInputSwitchEventDetail>

Slots

SlotDescription
"default"Put text string or elements here

CSS Custom Properties

NameDescription
--mds-input-switch-animation-timing-adjustSet the size multiplier when the switch toggle is resizing by animation
--mds-input-switch-animation-timing-functionSet the timing function of the animation
--mds-input-switch-box-color-checkedSet the color of the switch when the switch is checked
--mds-input-switch-box-color-disabled-checkedSet the color of the switch when the switch is disabled and checked
--mds-input-switch-box-color-disabled-uncheckedSet the color of the switch when the switch is disabled and unchecked
--mds-input-switch-box-color-uncheckedSet the color of the switch when the switch is unchecked
--mds-input-switch-box-padding-lgSet the padding of the switch toggle's container
--mds-input-switch-box-padding-mdSet the padding of the switch toggle's container
--mds-input-switch-box-padding-smSet the padding of the switch toggle's container
--mds-input-switch-durationSet the duration of the animation
--mds-input-switch-icon-color-checkedSet the color of the icon when the switch is checked
--mds-input-switch-icon-color-checked-disabledSet the color of the icon when the switch is disabled and checked
--mds-input-switch-icon-color-indeterminateSet the color of the icon when the switch is indeterminate
--mds-input-switch-icon-color-indeterminate-disabledSet the color of the icon when the switch is disabled and indeterminate
--mds-input-switch-icon-color-uncheckedSet the color of the icon when the switch is unchecked
--mds-input-switch-icon-color-unchecked-disabledSet the color of the icon when the switch is disabled and unchecked
--mds-input-switch-toggle-color-checkedSet the color of the switch toggle when the switch is checked
--mds-input-switch-toggle-color-disabled-checkedSet the color of the switch toggle when the switch is disabled and checked
--mds-input-switch-toggle-color-disabled-uncheckedSet the color of the switch toggle when the switch is disabled and unchecked
--mds-input-switch-toggle-color-uncheckedSet the color of the switch toggle when the switch is unchecked
--mds-input-switch-toggle-size-lgSets the size of the switch toggle
--mds-input-switch-toggle-size-mdSets the size of the switch toggle
--mds-input-switch-toggle-size-smSets the size of the switch toggle

Dependencies

Depends on

Graph

graph TD;
  mds-input-switch --> mds-icon
  mds-input-switch --> mds-text
  style mds-input-switch fill:#f9f,stroke:#333,stroke-width:4px

Built with love @ Gruppo Maggioli from R&D Department

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago