Skip to content

Variable: TileLayout ​

ts
const TileLayout: DefineComponent<ExtractPropTypes<{
  animate: {
     default: boolean;
     type: PropType<
        | boolean
        | {
        duration?: number;
        easing?: string;
     }>;
  };
  aspects: PropType<readonly number[]>;
  background: StringConstructor;
  cellClass: PropType<unknown>;
  cellLabel: PropType<PerCell<string | undefined>>;
  cellStyle: PropType<PerCell<StyleMap | undefined>>;
  choose: PropType<"placement" | "shape">;
  contentCells: PropType<ContentCells>;
  fill: PropType<FillSource>;
  fit: {
     default: boolean;
     type: PropType<FitProp>;
  };
  focalPoints: PropType<readonly (Focus | undefined)[]>;
  focusRing: {
     default: string;
     type: PropType<string | false>;
  };
  layout: PropType<Layout>;
  navigable: BooleanConstructor;
  onCellActivate: PropType<(cell, state) => void>;
  options: PropType<LayoutOptions>;
  placement: PropType<ContentPlacement>;
  relief: {
     default: boolean;
     type: PropType<boolean | ReliefOptions>;
  };
  role: {
     default: string;
     type: StringConstructor;
  };
  safeArea: {
     default: boolean;
     type: PropType<SafeAreaProp>;
  };
  virtualize: {
     default: boolean;
     type: PropType<
        | boolean
        | {
        overscan?: number;
     }>;
  };
  weights: PropType<readonly number[]>;
}>, () => VNode<RendererNode, RendererElement, {
[key: string]: any;
}>, {
}, {
}, {
}, ComponentOptionsMixin, ComponentOptionsMixin, {
}, string, PublicProps, ToResolvedProps<ExtractPropTypes<{
  animate: {
     default: boolean;
     type: PropType<
        | boolean
        | {
        duration?: number;
        easing?: string;
     }>;
  };
  aspects: PropType<readonly number[]>;
  background: StringConstructor;
  cellClass: PropType<unknown>;
  cellLabel: PropType<PerCell<string | undefined>>;
  cellStyle: PropType<PerCell<StyleMap | undefined>>;
  choose: PropType<"placement" | "shape">;
  contentCells: PropType<ContentCells>;
  fill: PropType<FillSource>;
  fit: {
     default: boolean;
     type: PropType<FitProp>;
  };
  focalPoints: PropType<readonly (Focus | undefined)[]>;
  focusRing: {
     default: string;
     type: PropType<string | false>;
  };
  layout: PropType<Layout>;
  navigable: BooleanConstructor;
  onCellActivate: PropType<(cell, state) => void>;
  options: PropType<LayoutOptions>;
  placement: PropType<ContentPlacement>;
  relief: {
     default: boolean;
     type: PropType<boolean | ReliefOptions>;
  };
  role: {
     default: string;
     type: StringConstructor;
  };
  safeArea: {
     default: boolean;
     type: PropType<SafeAreaProp>;
  };
  virtualize: {
     default: boolean;
     type: PropType<
        | boolean
        | {
        overscan?: number;
     }>;
  };
  weights: PropType<readonly number[]>;
}>, {
}>, {
  animate:   | boolean
     | {
     duration?: number;
     easing?: string;
   };
  fit: FitProp;
  focusRing: string | false;
  navigable: boolean;
  relief: boolean | ReliefOptions;
  role: string;
  safeArea: SafeAreaProp;
  virtualize:   | boolean
     | {
     overscan?: number;
   };
}, {
}, {
}, {
}, string, ComponentProvideOptions, true, {
}, any>;

A tiling as HTML: one absolutely positioned, clip-path-ed element per tile, holding whatever you put in it. Each top-level child of the default slot fills one tile, in reading order (v-for children count one each). Or use the cell slot, given { cell, slot }, to fill every tile. Sized in percentages, so it scales with its width.

Slots: default (the items), cell (instead of items), fallback (empty tiles, given { cell, state }) and backdrop (one picture across all the tiles). Emits cell-activate with (cell, state). Props match the React <TileLayout>.

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).