import * as React from "react"; import { StyleProp, ViewStyle, GestureResponderEvent } from "react-native"; import { DefaultTheme } from "styled-components"; declare type Props = { /** * Icon to display for the `ToggleButton`. */ icon: React.ReactElement; /** * Size of the icon. */ size?: number; /** * Custom text color for button.s */ color?: string; /** * Whether the button is disabled. */ disabled?: boolean; /** * Accessibility label for the `ToggleButton`. This is read by the screen reader when the user taps the button. */ accessibilityLabel?: string; /** * Function to execute on press. */ onPress?: (value?: GestureResponderEvent | string) => void; /** * Value of button. */ value?: string; /** * Status of button. */ status?: "checked" | "unchecked"; style?: StyleProp; /** * @optional */ theme?: DefaultTheme; }; /** * Toggle buttons can be used to group related options. To emphasize groups of related toggle buttons, * a group should share a common container. * *
* *
* * ## Usage * ```js * import * as React from 'react'; * import ToggleButton from 'react-native-simple-elements/components/ToggleButton'; * * const ToggleButtonExample = () => { * const [status, setStatus] = React.useState('checked'); * * const onButtonToggle = value => { * setStatus(status === 'checked' ? 'unchecked' : 'checked'); * }; * * return ( * * ); * }; * * export default ToggleButtonExample; * * ``` */ declare const ToggleButton: ({ icon, size, accessibilityLabel, disabled, style, value, status, onPress, ...rest }: Props) => JSX.Element; export default ToggleButton; declare const ToggleButtonWithTheme: ({ icon, size, accessibilityLabel, disabled, style, value, status, onPress, ...rest }: Props) => JSX.Element; export { ToggleButtonWithTheme as ToggleButton };