How to use the @uifabric/experiments.getTileLayout function in @uifabric/experiments

To help you get started, we’ve selected a few @uifabric/experiments examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / packages / experiments / src / components / Tile / examples / Tile.Media.Example.tsx View on Github external
,
            
          ]}
        >
          {props.item.activity}
        
      }
      background={
        <span> // Placeholder content
      }
      hideBackground={!props.showBackground}
      showBackgroundFrame={true}
    /&gt;
  );

  const { backgroundSize } = getTileLayout(tile);

  const imageSize = fitContentToBounds({
    contentSize: props.originalImageSize,
    boundsSize: backgroundSize || { width: 0, height: 0 },
    mode: 'cover'
  });

  return (
    <div style="{{"></div></span>
github OfficeDev / office-ui-fabric-react / packages / experiments / src / components / Tile / examples / Tile.Document.Example.tsx View on Github external
): JSX.Element =&gt; {
  const tile = (
    }&gt;{props.item.name}}
      itemActivity={{'12'}}&gt;{props.item.activity}}
      foreground={<span>}
      hideForeground={!props.showForeground}
      showForegroundFrame={true}
    /&gt;
  );

  const { foregroundSize = { width: 0, height: 0 } } = getTileLayout(tile);

  const imageSize = fitContentToBounds({
    contentSize: props.originalImageSize,
    boundsSize: foregroundSize,
    mode: 'contain'
  });

  return (
    <div>
      {renderTileWithLayout(tile, {
        foreground: (
          <img src="{`//placehold.it/${Math.round(imageSize.width)}x${Math.round(imageSize.height)}`}">
        )</div></span>