IconButton
An icon button is a button which displays only an icon without a label.
How to use
import React from 'react';
import {IconButton} from '@gyri/native-ui-components';
const MyComponent = () => (
<IconButton
icon="camera"
size={20}
onPress={() => console.log('Pressed')}
/>
);
export default MyComponent;
Props
| # | Name | Data type | Default value | Values | Description |
|---|---|---|---|---|---|
| 1 | icon (required) | string | |||
| 2 | size | number | 24 | ||
| 3 | onPress | function | |||
| 4 | mode | 'outlined', 'contained', 'contained-tonal' | Mode of the icon button. | ||
| 5 | iconColor | string | Color of the icon. | ||
| 6 | containerColor | string | Background color of the icon container. | ||
| 7 | rippleColor | Color of the ripple effect. | |||
| 8 | disabled | boolean | Whether the button is disabled. | ||
| 9 | loading | boolean | false | Whether the show a loading indicator. |
For more details https://callstack.github.io/react-native-paper/docs/components/IconButton/