Check out our free templates made with AI and polished to perfection in Windframe
Get nowTailwind CSS Grid Row Start/End
The grid-row-start and grid-row-end utilities in Tailwind control where an element’s row starts and ends within a CSS Grid layout. They define how many rows an element spans or where it’s positioned vertically.
Tailwind Grid Row Start/End
The grid-row-start
and grid-row-end
utilities in Tailwind control where an element’s row starts and ends within a CSS Grid layout. They define how many rows an element spans or where it’s positioned vertically.
How to apply Tailwind Grid Row Start/End
To apply row start and end positions to a grid item, you can use the tailwind row-{start/end}
-{line}
utility classes, where {start/end}
represents the desired start and end positions, and {line}
represents the line number or name of the grid track.
<div class="h-64 grid grid-rows-3 grid-flow-col gap-4"> <div class="bg-blue-500 row-start-1 row-end-2">Item 1</div> <div class="bg-blue-500">Item 2</div> <div class="bg-blue-500 row-span-2">Item 3</div></div>
Preview
Item 1
items 2
items 3
Responsive Tailwind Grid Row Start/End
Tailwind CSS allows you to apply row start and end positions responsively at different breakpoints. To use responsive tailwind grid row start/end classes, you can append the breakpoint prefix to the utility classes. For example, md:grid-row-start-2
sets the start position to the second row starting from the medium breakpoint and above. Here's an example:
<div class="grid grid-cols-2 md:grid-cols-3"> <div class="bg-indigo-500 md:grid-row-start-2 md:grid-row-end-4">Item 1</div> <div class="bg-indigo-500">Item 2</div> <div class="bg-indigo-500">Item 3</div></div>
Preview
Item 1
In the above example, a grid container with 2 columns by default (grid-cols-2) and 3 columns starting from the medium breakpoint and above (md:grid-cols-3) is created. The md:grid-row-start-2
class is applied to the first grid item (Item 1) to specify that it should start at the second row from the medium breakpoint, and the md:grid-row-end-4
class is used to specify that it should end at the fourth row.
Arbitrary Value Usage
You can set custom start/end values with arbitrary syntax:
<div class="grid grid-rows-[repeat(6,minmax(0,1fr))]"> <div class="row-start-[2] row-end-[5] bg-purple-300">Custom lines</div></div>
Preview
Custom lines
Useful when you’re working with dynamic or non-standard grid templates.
Customization in tailwind.config.js
Extend grid row utilities to match your design system:
module.exports = { theme: { extend: { gridRowStart: { 13: "13", }, gridRowEnd: { 13: "13", }, }, },};
Now you can use:
<div class="row-start-13 row-end-13"></div>
Real UI Component Example
Event Schedule Layout
<div class="grid grid-rows-[repeat(12,minmax(0,1fr))] gap-2 h-[600px]"> <div class="bg-blue-200 row-start-1 row-end-4 p-2 rounded"> <h3 class="font-bold">Morning Standup</h3> <p>9:00 - 10:30 AM</p> </div> <div class="bg-green-200 row-start-4 row-end-7 p-2 rounded"> <h3 class="font-bold">Project Review</h3> <p>10:30 AM - 12:00 PM</p> </div> <div class="bg-yellow-200 row-start-7 row-end-9 p-2 rounded"> <h3 class="font-bold">Lunch Break</h3> </div> <div class="bg-purple-200 row-start-9 row-end-12 p-2 rounded"> <h3 class="font-bold">Design Workshop</h3> </div></div>
Preview
Morning Standup
9:00 - 10:30 AM
Project Review
10:30 AM - 12:00 PM
Lunch Break
Design Workshop
This design makes it easy to visualize a calendar or scheduler UI.
Best Practices
-
Use row-span for simple spans and row-start/row-end for precise control.
-
Keep grid templates explicit in grid-template-rows for maintainability.
-
Avoid overusing arbitrary values unless necessary — it can reduce clarity.
-
Combine with col-start/col-end for full two-dimensional control.
Tailwind Grid Row start/end Class Table
Class | Properties |
---|---|
row-auto | grid-row: auto; |
row-span-1 | grid-row: span 1 / span 1; |
row-span-2 | grid-row: span 2 / span 2; |
row-span-3 | grid-row: span 3 / span 3; |
row-span-4 | grid-row: span 4 / span 4; |
row-span-5 | grid-row: span 5 / span 5; |
row-span-6 | grid-row: span 6 / span 6; |
row-span-full | grid-row: 1 / -1; |
row-start-1 | grid-row-start: 1; |
row-start-2 | grid-row-start: 2; |
row-start-3 | grid-row-start: 3; |
row-start-4 | grid-row-start: 4; |
row-start-5 | grid-row-start: 5; |
row-start-6 | grid-row-start: 6; |
row-start-7 | grid-row-start: 7; |
row-start-auto | grid-row-start: auto; |
row-end-1 | grid-row-end: 1; |
row-end-2 | grid-row-end: 2; |
row-end-3 | grid-row-end: 3; |
row-end-4 | grid-row-end: 4; |
row-end-5 | grid-row-end: 5; |
row-end-6 | grid-row-end: 6; |
row-end-7 | grid-row-end: 7; |
row-end-auto | grid-row-end: auto; |
📚 Ready to Keep Going?
Windframe is an AI visual editor for rapidly building stunning web UIs & websites
Start building stunning web UIs & websites!
