Embedding
React Native

React Native embeddingBeta

Komo cards can be embedded into your React Native application through Komo's NPM package.

Installation

npm install @komo-tech/react-native-widgets

NOTE: This package (opens in a new tab) has a peer dependency on react-native-webview (opens in a new tab), and recommends the latest major version, 11.x.

Usage

From the Komo portal, navigate to the settings of the card to be embedded. Select the Embed tab and copy the Native embed URL in the right sidebar. Pass as a prop to the KomoCardWidget, along with any optional styling or render props detailed below.

import { KomoCardWidget } from '@komo-tech/react-native-widgets';
 
// ...
 
<KomoCardWidget embedUrl={KomoCardNativeEmbedUrl} />;

Props


NameTypeDescriptionOptional
embedUrlstringThe native embed url taken from the Komo portal settings of the card to be embeddedfalse
appIdstringUseful for the embedded Komo content to identify where it's being embeddedtrue
containerStyleStyleProp<ViewStyle>Style overrides for the container of the card cover (including both image and CTA button)true
coverImageStyleStyleProp<ImageStyle>Style overrides for the image of the card covertrue
buttonStyleStyleProp<ViewStyle>Style overrides for the CTA button of the card covertrue
buttonTextStyleStyleProp<TextStyle>Style overrides for the CTA button text of the card covertrue
coverLoaderReactNodeThe loader shown while the cover is loading (defaults to a skeleton card loader)true
hideCoverButtonbooleanHide the CTA button of the covertrue
modalHeaderReactNodeThe header of the modal to render instead of the defaulttrue
onError(error) => voidCallback on errortrue
onModalClose() => voidCallback on modal closetrue
onModalOpen() => voidCallback on modal opentrue
shareClickUrlstringOverride of the url that redirects a user when clicking on a share linktrue