@synergy-design-system/react
Version:
React wrappers for the Synergy Design System
45 lines (44 loc) • 2.33 kB
TypeScript
import Component from '@synergy-design-system/components/components/switch/switch.component.js';
import { type EventName } from '@lit/react';
import type { SynBlurEvent } from '@synergy-design-system/components';
import type { SynChangeEvent } from '@synergy-design-system/components';
import type { SynInputEvent } from '@synergy-design-system/components';
import type { SynFocusEvent } from '@synergy-design-system/components';
import type { SynInvalidEvent } from '@synergy-design-system/components';
/**
* @summary Switches allow the user to toggle an option on or off.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-switch--docs
* @status stable
* @since 2.0
*
* @slot - The switch's label.
* @slot help-text - Text that describes how to use the switch. Alternatively, you can use the `help-text` attribute.
*
* @event syn-blur - Emitted when the control loses focus.
* @event syn-change - Emitted when the control's checked state changes.
* @event syn-input - Emitted when the control receives input.
* @event syn-focus - Emitted when the control gains focus.
* @event syn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
*
* @csspart base - The component's base wrapper.
* @csspart control - The control that houses the switch's thumb.
* @csspart thumb - The switch's thumb.
* @csspart label - The switch's label.
* @csspart form-control-help-text - The help text's wrapper.
*
* @cssproperty --width - The width of the switch.
* @cssproperty --height - The height of the switch.
* @cssproperty --thumb-size - The size of the thumb.
*/
export declare const SynSwitch: import("@lit/react").ReactWebComponent<Component, {
onSynBlur: EventName<SynBlurEvent>;
onSynChange: EventName<SynChangeEvent>;
onSynInput: EventName<SynInputEvent>;
onSynFocus: EventName<SynFocusEvent>;
onSynInvalid: EventName<SynInvalidEvent>;
}>;
export type { SynBlurEvent } from '@synergy-design-system/components';
export type { SynChangeEvent } from '@synergy-design-system/components';
export type { SynInputEvent } from '@synergy-design-system/components';
export type { SynFocusEvent } from '@synergy-design-system/components';
export type { SynInvalidEvent } from '@synergy-design-system/components';