Grid Row Start / End

    Utilities for controlling how elements are sized and placed across grid rows.

    Show all classes

    Use the utilities to make an element span n rows.

    Starting and ending lines

    Use the row-start-{n} and row-end-{n} utilities to make an element start or end at the nth grid line. These can also be combined with the row-span-{n} utilities to span a specific number of rows.

    Note that CSS grid lines start at 1, not 0, so a full-height element in a 3-row grid would start at line 1 and end at line 4.

    1. <div class="grid grid-rows-3 grid-flow-col gap-4">
    2. <div class="row-end-3 row-span-2 ...">02</div>
    3. <div class="row-start-1 row-end-4 ...">03</div>
    4. </div>

    Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:row-span-4 to only apply the row-span-4 utility on hover.

    For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.

    Breakpoints and media queries

    You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:row-span-4 to apply the row-span-4 utility at only medium screen sizes and above.

    1. <div class="row-span-3 md:row-span-4">
    2. <!-- ... -->
    3. </div>

    To learn more, check out the documentation on Responsive Design, and other media query modifiers.


    By default, Tailwind includes grid-row utilities for working with grids with up to 6 explicit rows. You can customize these values by editing theme.gridRow, , theme.gridRowStart, theme.extend.gridRowStart, theme.gridRowEnd, and theme.extend.gridRowEnd in your tailwind.config.js file.

    For creating more row-{value} utilities that control the grid-row shorthand property directly, customize the gridRow section of your Tailwind theme config:

    We use this internally for our row-span-{n} utilities. Note that since this configures the grid-row shorthand property directly, we include the word span directly in the value name, it’s not baked into the class name automatically. That means you are free to add entries that do whatever you want here — they don’t just have to be span utilities.

    To add new row-start-{n} utilities, use the gridRowStart section of your Tailwind theme config:

    tailwind.config.js

    1. module.exports = {
    2. theme: {
    3. gridRowStart: {
    4. '8': '8',
    5. '10': '10',
    6. '11': '11',
    7. '12': '12',
    8. '13': '13',
    9. }
    10. }
    11. }
    12. }

    To add new row-end-{n} utilities, use the gridRowEnd section of your Tailwind theme config:

    tailwind.config.js

    Learn more about customizing the default theme in the documentation.

    Arbitrary values

    1. <div class="row-[span_16_/_span_16]">
    2. <!-- ... -->

    Learn more about arbitrary value support in the documentation.