Skip to content

Tile Components ​

The SDK provides various tile components for displaying different types of content. All tile components support both direct data passing and fetching by ID.

Common Features ​

All tile components share these common features:

  • Automatic loading states with skeletons
  • Error handling
  • Support for fetching by ID
  • Responsive design

Usage ​

With Direct Data ​

jsx
import { ContentTile, RewardTile } from '@wlloyalty/wll-react-native-sdk';

function MyComponent() {
  const tileData = {
    type: 'CONTENT',
    title: 'My Content',
    // ... other tile properties
  };

  return <ContentTile tile={tileData} />;
}

Fetching by ID ​

All tile components support fetching by ID:

jsx
import { ContentTile, RewardTile } from '@wlloyalty/wll-react-native-sdk';

function MyComponent() {
  return (
    <>
      <ContentTile tileId="content-tile-id" />
      <RewardTile tileId="reward-tile-id" />
    </>
  );
}

Props ​

Each tile component accepts these common props:

NameTypeRequiredDescription
tileTileNoTile data object
tileIdstringNoID of the tile to fetch

Note

Either tile or tileId must be provided, but not both.

Loading States ​

When fetching a tile by ID, components will display:

  • A loading skeleton during the fetch
  • An error message if the fetch fails
  • The tile content once loaded successfully

Available Tile Components ​

ComponentTypeDescription
<ContentTile />CONTENTDisplays general content
<RewardTile />REWARDShows reward information
<PointsTile />POINTSDisplays points-related content
<BadgeTile />BADGEShows badge information
<BannerTile />BANNERDisplays banner content
<RewardCategoryTile />REWARD_CATEGORYShows reward category information
<VenueTile />VENUEShows venue information

Each tile type has its own specific props and features documented in their respective component pages.

Released under the MIT License.