<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Meera9</title>
    <description>The latest articles on DEV Community by Meera9 (@meera9).</description>
    <link>https://dev.to/meera9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F751865%2F04035016-8553-4874-a02d-cc571e18f6e0.jpeg</url>
      <title>DEV Community: Meera9</title>
      <link>https://dev.to/meera9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/meera9"/>
    <language>en</language>
    <item>
      <title>How I Fixed Broken Portrait/Landscape Gallery Alignment (and Open-Sourced It)</title>
      <dc:creator>Meera9</dc:creator>
      <pubDate>Fri, 31 Jul 2026 06:57:48 +0000</pubDate>
      <link>https://dev.to/meera9/how-i-fixed-squarespaces-broken-portraitlandscape-gallery-alignment-and-open-sourced-it-3gfi</link>
      <guid>https://dev.to/meera9/how-i-fixed-squarespaces-broken-portraitlandscape-gallery-alignment-and-open-sourced-it-3gfi</guid>
      <description>&lt;h1&gt;
  
  
  Why I Built a Responsive Image Strip Gallery (and Published It for Every Framework)
&lt;/h1&gt;

&lt;p&gt;A few weeks ago I ran into a layout problem that sounds simple on paper: put portrait and landscape photos in the same row, aligned, without cropping them into ugly square boxes.&lt;/p&gt;

&lt;p&gt;It turned out that no gallery — not Squarespace's built-in options, not the popular npm galleries — actually solves this cleanly. So I built one myself: &lt;a href="https://www.npmjs.com/package/@meerathanki09/image-strip-gallery" rel="noopener noreferrer"&gt;image-strip-gallery&lt;/a&gt;, a fixed-column strip gallery that works in React, Vue, Angular, Svelte, plain JS, and as a copy-paste block for Squarespace and WordPress.&lt;/p&gt;

&lt;p&gt;Here's the problem, why the usual answers fall short, and how the package solves it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: masonry breaks on mixed orientations
&lt;/h2&gt;

&lt;p&gt;Squarespace's Section and Masonry gallery types are great for uniform grids, but they have a specific weakness — they don't keep portrait and landscape images aligned on the same row. Because masonry layouts stack images into columns of varying height, a tall portrait photo and a wide landscape photo end up with mismatched row baselines. You lose that clean, editorial "strip" look where six photos of different shapes sit level with each other.&lt;/p&gt;

&lt;p&gt;This isn't a hypothetical problem — I found a whole &lt;a href="https://forum.squarespace.com/topic/339316-strips-layout-gallery-mix-with-potrait-and-landscape-with-6-column-with-6-images-same-alignment/#comment-876114" rel="noopener noreferrer"&gt;Squarespace forum thread&lt;/a&gt; of people asking for exactly this and getting workarounds instead of a real fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  The usual workaround — and why it's a bad trade
&lt;/h2&gt;

&lt;p&gt;The common fix is to force every image into the same crop box: uniform width, uniform height, &lt;code&gt;object-fit: cover&lt;/code&gt;. Rows do line up — but you lose composition. A landscape shot gets cropped into a square, a portrait gets its subject clipped. For photography-led sites (portfolios, product shots, editorial layouts), that's not acceptable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the package actually does
&lt;/h2&gt;

&lt;p&gt;Instead of cropping, the gallery keeps each image's natural aspect ratio and solves alignment at the row level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A fixed number of images per row (default: 6 desktop, 2 mobile)&lt;/li&gt;
&lt;li&gt;Every row shares one height&lt;/li&gt;
&lt;li&gt;Each image's width is calculated from its own aspect ratio to fit that shared row height&lt;/li&gt;
&lt;li&gt;Portrait and landscape images sit side by side in the same row, fully aligned, uncropped&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is the "strip" look people were asking for on that forum thread — without the crop-box compromise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built for how people actually ship sites today
&lt;/h2&gt;

&lt;p&gt;Because I do full-stack work across Laravel, Vue, and React projects — and because half my audience for this needed a no-code option — I shipped it two ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A copy-paste HTML/CSS/JS version for Squarespace and WordPress — no npm, no build step, just paste into a Code Block and Custom CSS panel.&lt;/li&gt;
&lt;li&gt;An npm package with dedicated entry points for React/Next.js and Vue/Nuxt, plus a vanilla-JS core that works directly in Angular, Svelte, or plain HTML.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's lightweight (no jQuery dependency), SSR-safe for Next.js, includes an optional row-by-row fade-in animation, and every layout parameter — columns, gap, breakpoint, row height, animation timing — is configurable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install @meerathanki09/image-strip-gallery&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ResponsiveImageStripGallery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@meerathanki09/image-strip-gallery/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ResponsiveImageStripGallery&lt;/span&gt;
  &lt;span class="na"&gt;images&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;images&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;desktop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;mobile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;onImageClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why I'm sharing this
&lt;/h2&gt;

&lt;p&gt;I build a lot of client sites where photography matters — portfolios, product pages, event galleries — and I kept hitting this same wall. Rather than solving it once per project, I built it as a reusable, framework-agnostic package and published it publicly so anyone hitting the same forum thread I found doesn't have to choose between misaligned rows and cropped photos.&lt;/p&gt;

&lt;p&gt;If you're dealing with the same layout problem, the package is free and MIT-licensed:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://www.npmjs.com/package/@meerathanki09/image-strip-gallery" rel="noopener noreferrer"&gt;npmjs.com/package/@meerathanki09/image-strip-gallery&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, issues, and PRs welcome.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
