1 | import * as React from 'react';
|
2 | import { StyleProp, ViewStyle } from 'react-native';
|
3 | declare type Props = {
|
4 | /**
|
5 | * Function to execute on selection change.
|
6 | */
|
7 | onValueChange: (value: string) => void;
|
8 | /**
|
9 | * Value of the currently selected toggle button.
|
10 | */
|
11 | value: string;
|
12 | /**
|
13 | * React elements containing toggle buttons.
|
14 | */
|
15 | children: React.ReactNode;
|
16 | style?: StyleProp<ViewStyle>;
|
17 | };
|
18 | /**
|
19 | * Toggle button row renders a group of toggle buttons in a row.
|
20 | *
|
21 | * <div class="screenshots">
|
22 | * <figure>
|
23 | * <img class="medium" src="screenshots/toggle-button-row.gif" />
|
24 | * </figure>
|
25 | * </div>
|
26 | *
|
27 | * ## Usage
|
28 | * ```js
|
29 | * import * as React from 'react';
|
30 | * import { ToggleButton } from 'react-native-paper';
|
31 | *
|
32 | * const MyComponent = () => {
|
33 | * const [value, setValue] = React.useState('left');
|
34 | *
|
35 | * return (
|
36 | * <ToggleButton.Row onValueChange={value => setValue(value)} value={value}>
|
37 | * <ToggleButton icon="format-align-left" value="left" />
|
38 | * <ToggleButton icon="format-align-right" value="right" />
|
39 | * </ToggleButton.Row>
|
40 | * );
|
41 | * };
|
42 | *
|
43 | * export default MyComponent;
|
44 | *
|
45 | *```
|
46 | */
|
47 | declare const ToggleButtonRow: {
|
48 | ({ value, onValueChange, children, style }: Props): JSX.Element;
|
49 | displayName: string;
|
50 | };
|
51 | export default ToggleButtonRow;
|
52 | export { ToggleButtonRow };
|