Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Latest commit

 

History

History
27 lines (22 loc) · 720 Bytes

ProportionalLayout.md

File metadata and controls

27 lines (22 loc) · 720 Bytes

ProportionalLayout

Lays-out renderables sequentially based on size-ratios (similar to the stock famo.us FlexibleLayout view).

options type description
ratios Array Size-ratios of the renderables.

Example:

var ProportionalLayout = require('famous-flex/layouts/ProportionalLayout');

var layoutController = new LayoutController({
  layout: ProportionalLayout,
  layoutOptions: {
    ratios: [1, 1, 2, 1],      // total size: 5
  },
  dataSource: [
    new Surface({content: 'item 1'}), // 20%
    new Surface({content: 'item 2'}), // 20%
    new Surface({content: 'item 3'}), // 40%
    new Surface({content: 'item 4'})  // 20%
  ]
});