Skip to content

MagazineLayout ​

Editorial hierarchy for news sites and blogs: a featured story, a column of secondary headlines, then a story grid. The grid also works for product lists and galleries.

Usage ​

vue
<template>
  <SuMagazineLayout :columns="3">
    <template #header>
      <h1>News</h1>
    </template>
    <template #featured>
      <StoryCard :story="lead" size="lg" />
    </template>
    <template #aside>
      <StoryLink v-for="story in headlines" :key="story.id" :story="story" />
    </template>

    <StoryCard v-for="story in stories" :key="story.id" :story="story" />
  </SuMagazineLayout>
</template>

Without featured or aside, only the grid remains: 1 column, 2 from 640px, then columns from 1024px. For a grid with no hierarchy (columns by width, automatic columns, list mode), prefer the GridLayout.

vue
<SuMagazineLayout :columns="4" gap="md">
  <ProductCard v-for="product in products" :key="product.id" :product="product" />
</SuMagazineLayout>

API ​

Props ​

PropTypeDefaultDescription
columns2 | 3 | 43Grid columns from a 1024px container
gap'none' | 'sm' | 'md' | 'lg' | 'xl''lg'Gap between areas and stories

Slots ​

SlotDescription
headerSection title, filters
featuredFeatured story
asideSecondary headlines, "most read" (stacked)
defaultGrid stories: each direct child is a cell

Responsive behavior ​

Container widthFeatured + secondaryGrid
< 640pxStacked1 column
≥ 640pxStacked2 columns
≥ 768pxFeatured 2/3 + secondary 1/32 columns
≥ 1024pxFeatured 2/3 + secondary 1/3columns columns

Accessibility ​

  • Reading order: featured, then secondary, then grid, matching the visual order.
  • Lists: for a list of stories, give your cards a list structure (role="list" on a container, or consistent heading levels) so screen readers announce how many there are.

Publié sous licence MIT.