3.0.1 • Published 8 months ago

@licuido-ui/ui_switch v3.0.1

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

Switch

The Switch component provides users with a switch for toggling between two mutually exclusive states.

Author

Link

Story Book Link to Switch

PlayGround

Try it have a fun codeBox

Installation

npm i @licuido-ui/ui_switch

Import component

import { Switch } from '@licuido-ui/ui_switch';

Usage

<Switch label={'My Label'} isLabel={true} />

Image

alt text

Sample Code

<Switch
  label={'My Label'}
  isLabel={true}
  id={''}
  className={''}
  sx={{}}
  switchSx={{}}
  switchTrackActiveStyle={{ backgroundColor: '#0C356A' }}
  switchTrackDefaultStyle={{ backgroundColor: '#d7e3ff' }}
  switchThumbActiveStyle={{ color: '#fff' }}
  switchThumbDefaultStyle={{ color: '#0C356A' }}
/>

Props

NameDescriptionDefaultControl
idstringstring
classNamestring""
sxThe system prop that allows defining system overrides as well as additional CSS styles.SxProps<Theme>{ }sx : {}
labelstring""sample label
isLabelbooleanfalseFalseTrue
switchSxSxProps<{}>{ }switchSx : {}
actionA ref for imperative actions currently only supports focusVisible() action.Ref<ButtonBaseActions>-Set object
centerRippleIf true, the ripples are centered They won't start at the cursor interaction position.booleanfalseSet boolean
disableTouchRippleIf true, the touch ripple effect is disabled.booleanfalseSet boolean
focusRippleIf true, the base button will have a keyboard focus ripple.booleanfalseSet boolean
focusVisibleClassName-Set string
LinkComponentThe component used to render a link when the href prop is provided.ElementType<any>'a'Set object
onFocusVisible--
TouchRipplePropsProps applied to the TouchRipple element--
touchRippleRefA ref that points to the TouchRipple elementref-
componentReactNodeReactNodeReactNode
labelStyleSxPropsSxPropsSxProps{}
switchTrackDefaultStyleSxPropsSxPropsSxProps{}
switchThumbDefaultStyleSxPropsSxPropsSxProps{}
switchTrackActiveStyleSxPropsSxPropsSxProps{}
switchThumbActiveStyleSxPropsSxPropsSxProps{}
formControlLabelStyleSxPropsSxPropsSxProps{}
labelPlacement'start' or 'end' or 'top' or 'bottom''start' or 'end' or 'top' or 'bottom'start