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