DynamicIcon đ
An enhanced Icon that can render any of the following:
BB.Components.Icon
BB.Components.Image
A custom component
Usage
Icon
The following example shows how to use BlueBase Icon component:
Image
The following example shows how to use an image as an icon:
Component
The following example shows how to use a custom component as an icon:
It is also possible to use a component registered in the ComponentRegistry by using it's name:
Properties
prop
type
required
default
description
type
'component' | 'icon' | 'image'
yes
-
If value is:
component
: Icon is a custom component, and looks for 'component' propicon
: Icon is an instance of BB.Components.Icon and looks for 'icon' propimage
: Icon is an instance of BB.Components.Image and looks for 'source' prop
component
React Component | string
-
-
Used when type is 'component'. Either a component or a component name (string). In case of string, it will be fetched from Component Registry.
name
string
-
-
Used when type is 'icon'. This is the name prop of the BB.Components.Icon component
source
Image Source Prop Type
-
-
Used when type is 'image'. This is the Image source.
size
number
-
100
Icon size.
testID
string
no
-
Used to locate this view in end-to-end tests.
Last updated