UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

71 lines (69 loc) 1.7 kB
import React from 'react'; import { BaseCheckboxProps } from '../checkbox/base-checkbox'; import { NonCancelableEventHandler } from '../internal/events'; /** * @awsuiSystem core */ export interface ToggleProps extends BaseCheckboxProps { /** * The control's label that's displayed next to the toggle. Clicking this will invoke a state change. * @displayname label */ children?: React.ReactNode; onChange?: NonCancelableEventHandler<ToggleProps.ChangeDetail>; /** * @awsuiSystem core */ /** * Attributes to add to the native `input` element. * Some attributes will be automatically combined with internal attribute values: * - `className` will be appended. * - Event handlers will be chained, unless the default is prevented. * * We do not support using this attribute to apply custom styling. * * @awsuiSystem core */ } export declare namespace ToggleProps { interface Ref { /** * Sets input focus onto the UI control. */ focus(): void; } interface ChangeDetail { checked: boolean; } interface Style { input: { background?: { checked?: string; default?: string; disabled?: string; readOnly?: string; }; handle?: { background?: { checked?: string; default?: string; disabled?: string; readOnly?: string; }; }; focusRing?: { borderColor?: string; borderRadius?: string; borderWidth?: string; }; }; label?: { color?: { checked?: string; default?: string; disabled?: string; readOnly?: string; }; }; } }