Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 759 Bytes

File metadata and controls

27 lines (22 loc) · 759 Bytes

react-native-app-helpers/createTiledComponent

Creates a new React component which shows a grid of equally sized tiles, flowing from left to right then wrapping onto a new line.

Usage

import { createTiledComponent } from "react-native-app-helpers";

const ExampleTiledComponent = createTiledComponent(
  20, // Column spacing.
  50, // Row spacing.
  150, // Minimum tile size.
  16 / 9, // Aspect ratio of each tile.  May be null for fluid height.
);

const ExampleScreen = () => (
  <ExampleTiledComponent>
    <Text key="A">Example Tile A</Text>
    <Text key="B">Example Tile B</Text>
    <Text key="C">Example Tile C</Text>
    <Text key="D">Example Tile D</Text>
    <Text key="E">Example Tile E</Text>
  </ExampleTiledComponent>
);