geoview-core - v2.1.2
    Preparing search index...

    Variable SwitchConst

    Switch: (props: ExtendedSwitchProps) => Element = SwitchUI

    Type Declaration

      • (props: ExtendedSwitchProps): Element
      • Create a customized Material UI Switch component.

        Wraps the Material-UI Switch with a FormControlLabel to ensure proper labeling and accessibility. Generates unique IDs to associate the label with the switch control.

        Parameters

        • props: ExtendedSwitchProps

          All valid Material-UI Switch props

        Returns Element

        The Switch component wrapped in FormControlLabel

        // Basic usage
        <Switch
        label="Toggle Switch"
        checked={isChecked}
        onChange={handleChange}
        />

        // Disabled state
        <Switch
        label="Disabled Switch"
        disabled
        checked={false}
        />

        // With size variant
        <Switch
        label="Small Switch"
        size="small"
        checked={isChecked}
        />