tailwindcss-grid-template-areas weekly downloads statistics
By hansanghyeon · npm · Tailwind plugins
A Tailwind CSS v4 plugin to provide utilities for CSS Grid template areas
tailwindcss-grid-template-areas has 7 recorded weekly downloads on npm, a decrease of 82.1% over the past 30 days, ranking #2122 of 2,322 tracked listings.
About tailwindcss-grid-template-areas
tailwindcss-grid-template-areas
A powerful Tailwind CSS v4 plugin for CSS Grid template areas with intuitive row/column separators.
Features
- 🎯 Simple Syntax: Only
grid-areas-[]pattern with clear separators - ⚡ Intuitive Separators: Pipe (
|) for rows, comma (,) for columns - 🔧 Underscore Freedom: Use underscores and hyphens freely in area names
- 📍 Grid Area Placement:
grid-in-[]utilities for arbitrary area assignment - ⚡ Tailwind CSS v4 Compatible: Built for the latest Tailwind CSS v4
- 🚀 Zero Configuration: Works out of the box with simple installation
Installation
npm install tailwindcss-grid-template-areas
Usage
Method 1: Production Build (Recommended)
Add the plugin to your main CSS file:
@import 'tailwindcss';
@plugin 'tailwindcss-grid-template-areas/plugin.js';
Method 2: Browser CDN
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script>
tailwind.config = {
plugins: [
function({ matchUtilities }) {
const normalizeValue = (value) => {
return value.replace(/\\\|/g, '|').replace(/ /g, '_')
}
matchUtilities({
'grid-areas': (value) => {
const normalizedValue = normalizeValue(value)
// Pipe for rows, comma for columns
if (normalizedValue.includes('|')) {
const rows = normalizedValue.split('|').map(row => {
const columns = row.split(',')
return `"${columns.join(' ')}"`
})
return { 'grid-template-areas': rows.join(' ') }
}
// Single row handling
if (normalizedValue.includes(',')) {
const columns = normalizedValue.split(',')
return { 'grid-template-areas': `"${columns.join(' ')}"` }
}
return { 'grid-template-areas': `"${normalizedValue}"` }
}
})
matchUtilities({
'grid-in': (value) => ({ 'grid-area': normalizeValue(value) })
})
}
]
}
</script>
Syntax Guide
Core Rules
- Pipe (
|): Separates rows - Comma (
,): Separates columns within a row - Underscore (
_): Allowed in area names - Hyphen (
-): Allowed in area names
Patterns
Single Row Layout
<div class="grid grid-areas-[main,sidebar]">
<main class="grid-in-[main]">Main Content</main>
<aside class="grid-in-[sidebar]">Sidebar</aside>
</div>
Generates: grid-template-areas: "main sidebar"
Multi-Row Layout
<div class="grid grid-areas-[nav,nav,nav|sidebar,main,ads|footer,footer,footer]">
<nav class="grid-in-[nav]">Navigation</nav>
<aside class="grid-in-[sidebar]">Sidebar</aside>
<main class="grid-in-[main]">Main Content</main>
<div class="grid-in-[ads]">Advertisements</div>
<footer class="grid-in-[footer]">Footer</footer>
</div>
Generates:
grid-template-areas:
"nav nav nav"
"sidebar main ads"
"footer footer footer";
Hero Layout
<div class="grid grid-areas-[hero-image,title|hero-image,content|hero-image,cta]">
<div class="grid-in-[hero-image]">Hero Image</div>
<h1 class="grid-in-[title]">Amazing Title</h1>
<p class="grid-in-[content]">Great content here</p>
<button class="grid-in-[cta]">Call to Action</button>
</div>
Complex Area Names
<div class="grid grid-areas-[hero_image,call-to-action]">
<div class="grid-in-[hero_image]">Hero with underscore</div>
<button class="grid-in-[call-to-action]">Button with hyphen</button>
</div>
Live Demo
🎨 View Live Demo - See all examples in action!
Why This Plugin?
Problem with Traditional Approach
/* Traditional CSS - verbose and hard to maintain */
.layout {
grid-template-areas:
"nav nav nav"
"sidebar main ads"
"footer footer footer";
}
Solution with Our Plugin
<!-- Simple, intuitive Tailwind utility -->
<div class="grid grid-areas-[nav,nav,nav|sidebar,main,ads|footer,footer,footer]">
Key Benefits
- Visual Structure: Pipes and commas mirror the actual grid layout
- No Configuration: Works immediately without theme setup
- Flexible Naming: Use underscores and hyphens naturally in area names
- Dynamic Usage: Perfect for JavaScript-driven layouts
Advanced Examples
Dynamic Grid with JavaScript
// Dynamically change grid areas
const areas = ['header', 'main_content', 'sidebar-ads', 'footer_area'];
const gridClass = `grid-areas-[${areas.join(',')}]`;
element.className = `grid ${gridClass}`;
// Dynamic area assignment
areas.forEach((area, index) => {
const child = element.children[index];
child.className = `grid-in-[${area}]`;
});
Responsive Layouts
<!-- Different layouts for different screen sizes -->
<div class="
grid
grid-areas-[main|sidebar]
md:grid-areas-[main,sidebar]
lg:grid-areas-[nav,nav,nav|main,sidebar,ads|footer,footer,footer]
">
<!-- Grid items -->
</div>
Browser Support
- Modern Browsers: Chrome 57+, Firefox 52+, Safari 10.1+, Edge 16+
- CSS Grid Support: Required for grid-template-areas functionality
- Tailwind CSS v4: Compatible with the latest Tailwind CSS v4
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT © hansanghyeon
Description from the npm listing.
- tailwindcss
- tailwindcss-plugin
- css
- css-grid
- grid-template-areas
- tailwind-v4
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Tailwind plugins plugins
All 20 tailwindcss-grid-template-areas alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/tailwindcss-grid-template-areas. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.