Type alias ToggleProps

ToggleProps: {
    componentProps?: SwitchProps;
    disabled?: boolean;
    helperText?: string;
    hideLabel?: boolean;
    label: string;
    onChange: ((value) => void);
    selectedLabelText?: {
        off: string;
        on: string;
    };
    style?: StyleProp<ViewStyle>;
    toggleWrapperStyle?: StyleProp<ViewStyle>;
    toggled: boolean;
}

Props for Toggle component

Type declaration

  • Optional componentProps?: SwitchProps

    Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this.

  • Optional disabled?: boolean

    Indicate if disabled

  • Optional helperText?: string

    Helper text to render

  • Optional hideLabel?: boolean

    Indicate if label should be hidden (label is used for accessibility even when hidden)

  • label: string

    Text to render

  • onChange: ((value) => void)
      • (value): void
      • onPress event returns the current value

        Parameters

        • value: boolean

        Returns void

  • Optional selectedLabelText?: {
        off: string;
        on: string;
    }

    Selected label text (if not set will not show)

    • off: string
    • on: string
  • Optional style?: StyleProp<ViewStyle>

    Style to set on the item

  • Optional toggleWrapperStyle?: StyleProp<ViewStyle>

    Style to set on the toggle wrapper itself

  • toggled: boolean

    Indicate if toggled

Generated using TypeDoc