Icon
Icons are visual indicators usually used to describe action or intent.
They are also used for displaying information.
#
UsageHint: use reverse to make your icon look like a button
#
Available Icon SetsThe icon sets in React Native Elements are made possible through react-native-vector-icons.
The current list of available icons sets are:
- antdesign
- entypo
- evilicon
- feather
- font-awesome
- font-awesome-5
- fontisto
- foundation
- ionicon
- material
- material-community
- octicon
- simple-line-icon
- zocial
#
Custom Icon FontsRegister your own custom icons by calling
registerCustomIconType('customid', customFont)
. Create a custom font by
following the
instructions for creating a custom font here.
Also, you can use Fontello to generate custom icon
fonts.
#
Props#
Icon- Component
- backgroundColor
- borderRadius
- brand
- color
- containerStyle
- disabled
- disabledStyle
- iconProps
- iconStyle
- name
- raised
- reverse
- reverseColor
- size
- solid
- style
- type
#
Reference#
Icon#
ComponentUpdate React Native Component.
Type | Default |
---|---|
React Component | Pressable or View |
#
backgroundColorBackground color of the button
Type | Default |
---|---|
string | '#007AFF' |
#
borderRadiusBorder radius of the button
Set to 0 to disable.
Type | Default |
---|---|
number | 5 |
#
brandUses the brands font (FontAwesome5 only).
Type | Default |
---|---|
boolean | false |
#
colorText and icon color
Use iconStyle or nest a Text component if you need different colors.
Type | Default |
---|---|
string | 'white' |
#
containerStyleAdd styling to container holding icon.
Type | Default |
---|---|
View style(Object) | None |
#
disabledIf true, disable all interactions for this component.
Disables onPress events. Only works when onPress
has a handler.
Type | Default |
---|---|
boolean | false |
#
disabledStyleStyle for the button when disabled. Only works when onPress
has a handler.
Type | Default |
---|---|
View style(Object) | None |
#
iconPropsProvide all props from react-native Icon component.
Type | Default |
---|---|
IconProps | None |
#
iconStyleStyles applied to the icon only
Good for setting margins or a different color.
Type | Default |
---|---|
TextStyle | {marginRight: 10} |
#
nameName of the icon to show
See Icon Explorer app
{@link https://github.com/oblador/react-native-vector-icons/tree/master/Examples/IconExplorer}
Type | Default |
---|---|
string | None |
#
raisedAdds box shadow to button.
Type | Default |
---|---|
boolean | false |
#
reverseReverses color scheme.
Type | Default |
---|---|
boolean | false |
#
reverseColorSpecify reverse icon color.
Type | Default |
---|---|
string | None |
#
sizeSize of the icon, can also be passed as fontSize in the style object.
Type | Default |
---|---|
number | 24 |
#
solidUses the solid font.
Type | Default |
---|---|
boolean | false |
#
styleStyle prop inherited from TextProps and TouchableWithoutFeedbackProperties
Only exist here so we can have ViewStyle or TextStyle
Type | Default |
---|---|
ViewStyle or TextStyle | None |
#
typeType of icon set. Supported sets here.
Type | Default |
---|---|
string | material |