Menu

Tailwind CSS Break Inside

Break Inside controls how content within a container behaves when it encounters a page or column break. It governs whether the flow of elements inside a container remains intact or if they are fragmented across multiple rows, columns, or pages. Tailwind CSS provides a set of utility classes to implement the break-inside property, simplifying its integration into your design workflow.

In this guide, we will learn how to use the break-inside utilities in Tailwind CSS, covering everything from basic implementation to responsive and conditional states.

ClassPropertiesExample
break-inside-autobreak-inside: auto;<div className="break-inside-auto"></div>
break-inside-avoidbreak-inside: avoid;<div className="break-inside-avoid"></div>
break-inside-avoid-pagebreak-inside: avoid-page;<div className="break-inside-avoid-page"></div>
break-inside-avoid-columnbreak-inside: avoid-column;<div className="break-inside-avoid-column"></div>

Overview of Break Inside

Adding the Break Inside

You can use Tailwind's Break Inside utilities to prevent child elements from splitting across columns or pages. The classes available for this functionality include break-inside-auto, break-inside-avoid, and break-inside-avoid-column. These correspond directly to the respective CSS values of auto, avoid, and avoid-column.

Here’s how you can implement the Break Inside utilities in Tailwind CSS using a responsive container:

This is a live editor. Play around with it!
export default function PreventColumnSplit() {
  return (
    <div className="columns-1 h-screen w-screen p-6">
      <div className="break-after-column bg-white transition-all">
        <h2 className="text-2xl font-semibold">
          Column Break
        </h2>
        <p>
          This section uses a <code>break-after-column</code>, enforcing the subsequent element to break into a new column. 
        </p>
      </div>

      {/* This Content that flows after the potential break */}
      <div className="bg-white break-inside-avoid pt-6">
        <h2 className="text-xl font-medium">
          Subsequent Content
        </h2>
        <p>
          This section uses a <code>break-inside-avoid</code> to avoid fragmenting into multiple columns. Remove the <code>break-inside-avoid</code> utility to break this line into another column.
        </p>
      </div>
    </div>
  );
}

States and Responsiveness

Tailwind supports conditional variants like hover, focus, and responsive breakpoints for Break Inside utilities. These state-based classes can help you define granular CSS behaviors for your content structure.

Hover and Focus States

Using variants like hover and focus, you can adjust the break-inside behavior dynamically based on user interactions. For example, this can be useful to emphasize or organize specific content on hover:

This is a live editor. Play around with it!
export default function HoverAvoidBreak() {
  return (
    <div className="columns-1 h-screen w-screen p-6">
      <div className="break-after-column bg-white transition-all">
        <h2 className="text-2xl font-semibold">
          Column Break
        </h2>
        <p>
          This section uses a <code>break-after-column</code>, enforcing the subsequent element to break into a new column. 
        </p>
      </div>

      {/* This Content that flows after the potential break */}
      <div className="bg-white hover:break-inside-avoid pt-6">
        <h2 className="text-xl font-medium">
          Subsequent Content
        </h2>
        <p>
          On hover, this section applies a <code>break-inside-avoid</code> to avoid fragmenting into multiple columns. By default, this line will come into another column, hover over this section to avoid breaking it inside.
        </p>
      </div>
    </div>
  );
}

Breakpoint Modifiers

Tailwind ensures you can apply the Break Inside rules conditionally for specific screen sizes. By combining media query breakpoints(sm, md, etc.) along with break-inside, you can seamlessly control content fragmentation across device sizes.

This is a live editor. Play around with it!
import React from "react";

export default function ResponsiveBreakControl() {
  return (
    <div className="columns-1 h-screen w-screen p-6">
      <div className="break-after-column bg-white transition-all">
        <h2 className="text-2xl font-semibold">
          Column Break
        </h2>
        <p>
          This section uses a <code>break-after-column</code>, enforcing the subsequent element to break into a new column. 
        </p>
      </div>

      {/* This Content that flows after the potential break */}
      <div className="bg-white md:break-inside-avoid pt-6">
        <h2 className="text-xl font-medium">
          Subsequent Content
        </h2>
        <p>
          On <code>md</code> breakpoint, this section applies a <code>break-inside-avoid</code> to avoid fragmenting into multiple columns. Below the <code>md</code> breakpoint, this line will come into another column.
        </p>
      </div>
    </div>
  );
}

Real World Examples

News Article Layout

A news article layout with proper section breaks and content flow control.

This is a live editor. Play around with it!
const NewsArticle = () => {
  const article = {
    title: "The Future of Sustainable Technology",
    author: "Emma Thompson",
    date: "February 5, 2025",
    sections: [
      {
        id: 1,
        title: "Introduction",
        content: "As we move further into the digital age, the importance of sustainable technology becomes increasingly apparent. The intersection of environmental consciousness and technological advancement presents both challenges and opportunities."
      },
      {
        id: 2,
        title: "Current Landscape",
        content: "The technology sector currently accounts for approximately 2% of global carbon emissions. However, innovations in green computing and energy-efficient hardware are showing promising results in reducing this environmental impact."
      },
      {
        id: 3,
        title: "Innovation Trends",
        content: "Several key trends are emerging in sustainable technology. From biodegradable electronics to carbon-neutral data centers, companies are investing heavily in environmentally conscious solutions. These innovations are not just good for the planet but also drive economic growth."
      },
      {
        id: 4,
        title: "Market Impact",
        content: "The sustainable technology market is expected to reach $50 billion by 2026. This growth is driven by increasing consumer demand for eco-friendly products and stricter environmental regulations worldwide."
      },
      {
        id: 5,
        title: "Future Perspectives",
        content: "Looking ahead, the integration of AI with sustainable technology presents exciting possibilities. Smart grids, predictive maintenance, and automated energy management systems are just the beginning of this revolution."
      },
      {
        id: 6,
        title: "Conclusion",
        content: "The future of sustainable technology is bright, but it requires continued innovation and commitment from both industry leaders and consumers. As we face growing environmental challenges, the role of sustainable technology becomes increasingly critical."
      }
    ]
  };

  return (
    <div className="p-4 bg-slate-50 h-full overflow-auto">
      <article className="columns-2 gap-4 prose prose-sm">
        <header className="break-after-column mb-4 not-prose">
          <h1 className="text-xl font-bold">{article.title}</h1>
          <div className="text-sm text-gray-600 mt-2">
            <span>{article.author}</span> • <span>{article.date}</span>
          </div>
        </header>

        {article.sections.map((section, index) => (
          <section 
            key={section.id} 
            className={`mb-4 break-inside-avoid ${
              index === 3 ? 'break-before-column' : ''
            }`}
          >
            <h2 className="text-lg font-semibold mb-2">{section.title}</h2>
            <p className="text-sm leading-relaxed text-gray-700">{section.content}</p>
          </section>
        ))}
      </article>
    </div>
  );
};

export default NewsArticle;

Academic Paper Preview

A multi-column academic paper layout with proper section breaks and references.

This is a live editor. Play around with it!
const AcademicPaper = () => {
  const paper = {
    title: "Analysis of Machine Learning Approaches in Climate Modeling",
    authors: ["Dr. Sarah Chen", "Prof. James Wilson", "Dr. Maria Garcia"],
    abstract: "This paper examines the effectiveness of various machine learning approaches in climate modeling and prediction. We analyze neural networks, random forests, and gradient boosting methods across different climate datasets.",
    sections: [
      {
        id: 1,
        title: "Introduction",
        content: "Climate modeling presents unique challenges due to the complexity of environmental systems and the vast amount of data involved. Machine learning approaches offer promising solutions to these challenges."
      },
      {
        id: 2,
        title: "Methodology",
        content: "Our study employed three distinct machine learning approaches: deep neural networks with LSTM layers, random forest ensembles, and XGBoost models. Each method was evaluated using standardized climate datasets from 2010-2024."
      },
      {
        id: 3,
        title: "Results",
        content: "Neural networks showed superior performance in long-term predictions, while random forests excelled at regional climate pattern recognition. Gradient boosting methods demonstrated particular strength in handling extreme weather events."
      },
      {
        id: 4,
        title: "Discussion",
        content: "The comparative analysis reveals that each method has distinct advantages in specific climate modeling scenarios. The choice of approach should be guided by the specific requirements of the modeling task."
      },
      {
        id: 5,
        title: "Technical Implementation",
        content: "Implementation was carried out using PyTorch for neural networks and scikit-learn for traditional ML models. All experiments were conducted on a distributed computing cluster with GPU acceleration."
      },
      {
        id: 6,
        title: "Conclusion",
        content: "Our findings suggest that a hybrid approach, combining multiple machine learning methods, may offer the most robust solution for comprehensive climate modeling systems."
      }
    ],
    references: [
      "Chen et al. (2024) 'Deep Learning in Climate Science'",
      "Wilson, J. (2023) 'Machine Learning for Environmental Modeling'",
      "Garcia, M. (2024) 'Comparative Analysis of ML Approaches'"
    ]
  };

  return (
    <div className="p-4 bg-white h-full overflow-auto">
      <article className="columns-2 gap-4">
        <header className="break-after-column mb-6">
          <h1 className="text-lg font-bold mb-2">{paper.title}</h1>
          <div className="text-xs text-gray-600 mb-3">
            {paper.authors.join(' • ')}
          </div>
          <div className="bg-gray-50 p-3 rounded">
            <h2 className="text-sm font-semibold mb-1">Abstract</h2>
            <p className="text-xs leading-relaxed text-gray-700">{paper.abstract}</p>
          </div>
        </header>

        {paper.sections.map((section, index) => (
          <section 
            key={section.id}
            className={`mb-4 break-inside-avoid ${
              index === 2 ? 'break-before-column' : ''
            }`}
          >
            <h2 className="text-sm font-semibold mb-2">{section.title}</h2>
            <p className="text-xs leading-relaxed text-gray-700">{section.content}</p>
          </section>
        ))}

        <section className="break-before-column mt-4">
          <h2 className="text-sm font-semibold mb-2">References</h2>
          <ul className="text-xs space-y-1 text-gray-700">
            {paper.references.map((ref, index) => (
              <li key={index}>[{index + 1}] {ref}</li>
            ))}
          </ul>
        </section>
      </article>
    </div>
  );
};

export default AcademicPaper;

Magazine Feature

A magazine-style feature article with pull quotes and sidebars.

This is a live editor. Play around with it!
const MagazineFeature = () => {
  const article = {
    title: "The Rise of Urban Gardens",
    subtitle: "How city dwellers are transforming concrete jungles into green oases",
    author: "Alex Rivera",
    mainContent: [
      {
        id: 1,
        content: "Urban gardening has experienced an unprecedented surge in popularity over the past decade. What began as a grassroots movement has evolved into a citywide phenomenon, with rooftops and abandoned lots transformed into thriving green spaces."
      },
      {
        id: 2,
        content: "City planners and environmental scientists agree that these urban gardens serve multiple purposes: they provide fresh produce, reduce urban heat island effects, and create community gathering spaces."
      },
      {
        id: 3,
        pullQuote: "We're not just growing food, we're growing communities.",
        attribution: "- Maria Chen, Urban Garden Initiative"
      },
      {
        id: 4,
        content: "The impact extends beyond environmental benefits. Studies show that participants in community garden projects report improved mental health and stronger neighborhood connections."
      },
      {
        id: 5,
        sidebar: {
          title: "Starting Your Urban Garden",
          tips: [
            "Choose appropriate containers",
            "Consider sunlight exposure",
            "Start with hardy plants",
            "Implement water conservation"
          ]
        }
      },
      {
        id: 6,
        content: "Looking ahead, urban gardening is poised to play a crucial role in sustainable city development. With innovative approaches like vertical farming and hydroponics, the potential for urban agriculture continues to expand."
      }
    ]
  };

  return (
    <div className="p-4 bg-emerald-50 h-full overflow-auto">
      <article className="columns-2 gap-4">
        <header className="break-after-column mb-6">
          <h1 className="text-xl font-bold mb-2">{article.title}</h1>
          <p className="text-sm text-emerald-700 mb-3">{article.subtitle}</p>
          <p className="text-xs text-gray-600">By {article.author}</p>
        </header>

        {article.mainContent.map((section) => {
          if (section.pullQuote) {
            return (
              <blockquote 
                key={section.id}
                className="break-inside-avoid break-before-column my-4 pl-4 border-l-4 border-emerald-500"
              >
                <p className="text-lg font-serif italic text-emerald-800">
                  {section.pullQuote}
                </p>
                <cite className="text-xs text-gray-600">{section.attribution}</cite>
              </blockquote>
            );
          }

          if (section.sidebar) {
            return (
              <aside 
                key={section.id}
                className="break-inside-avoid break-before-column mb-4 bg-white p-4 rounded-lg"
              >
                <h3 className="text-sm font-semibold mb-2">{section.sidebar.title}</h3>
                <ul className="text-xs space-y-1 text-gray-700">
                  {section.sidebar.tips.map((tip, index) => (
                    <li key={index}>• {tip}</li>
                  ))}
                </ul>
              </aside>
            );
          }

          return (
            <p 
              key={section.id}
              className="mb-4 text-sm leading-relaxed text-gray-700 break-inside-avoid"
            >
              {section.content}
            </p>
          );
        })}
      </article>
    </div>
  );
};

export default MagazineFeature;

Book Chapter Preview

A book chapter layout with section breaks, footnotes, and margin notes.

This is a live editor. Play around with it!
const BookChapter = () => {
  const chapter = {
    title: "Chapter 3: The Evolution of Digital Privacy",
    book: "The Digital Age: Rights and Responsibilities",
    author: "Dr. Thomas Moore",
    sections: [
      {
        id: 1,
        content: "The concept of privacy in the digital age has undergone radical transformation. What was once a clear line between public and private has become increasingly blurred by technological advancement.",
        marginNote: "Historical context: Pre-internet privacy norms"
      },
      {
        id: 2,
        content: "Early internet users enjoyed relative anonymity, but the rise of social media and sophisticated tracking technologies has fundamentally altered the landscape of digital privacy.",
        footnote: "Studies from 1995-2000 show minimal concerns about online privacy among early internet users."
      },
      {
        id: 3,
        subheading: "The Social Media Revolution",
        content: "Social networks introduced a new paradigm of voluntary information sharing. Users began trading privacy for convenience and social connection, often without fully understanding the implications."
      },
      {
        id: 4,
        content: "Data collection and analysis capabilities have grown exponentially. Modern algorithms can derive surprisingly accurate insights from seemingly innocuous data points.",
        marginNote: "Key development: Machine learning in data analysis"
      },
      {
        id: 5,
        subheading: "Privacy in the Age of AI",
        content: "Artificial intelligence has introduced new challenges to digital privacy. The ability to process and analyze vast amounts of data has created both opportunities and risks for individual privacy.",
        footnote: "Recent AI models can predict user behavior with 89% accuracy using minimal data points."
      },
      {
        id: 6,
        content: "Looking ahead, the future of digital privacy will likely require a delicate balance between technological innovation and personal rights. New frameworks for data protection continue to emerge.",
        marginNote: "Future implications for privacy laws"
      }
    ]
  };

  return (
    <div className="p-4 bg-amber-50 h-full overflow-auto">
      <article className="columns-2 gap-4">
        <header className="break-after-column mb-6">
          <p className="text-sm text-gray-600 mb-1">{chapter.book}</p>
          <h1 className="text-xl font-serif mb-2">{chapter.title}</h1>
          <p className="text-sm text-gray-700">By {chapter.author}</p>
        </header>

        <div className="relative">
          {chapter.sections.map((section, index) => (
            <div key={section.id}>
              {section.subheading && (
                <h2 
                  className="text-lg font-serif mb-2 break-inside-avoid break-before-column"
                >
                  {section.subheading}
                </h2>
              )}
              
              <div className="flex gap-4 mb-4">
                {section.marginNote && (
                  <div className="w-1/4">
                    <p className="text-xs text-amber-800 italic break-inside-avoid">
                      {section.marginNote}
                    </p>
                  </div>
                )}
                
                <div className={`${section.marginNote ? 'w-3/4' : 'w-full'}`}>
                  <p className="text-sm leading-relaxed text-gray-700 break-inside-avoid">
                    {section.content}
                  </p>
                  {section.footnote && (
                    <p className="text-xs text-gray-500 mt-1 break-inside-avoid">
                      * {section.footnote}
                    </p>
                  )}
                </div>
              </div>
            </div>
          ))}
        </div>
      </article>
    </div>
  );
};

export default BookChapter;

Newsletter Layout

A professional newsletter with distinct sections and proper content flow.

This is a live editor. Play around with it!
const Newsletter = () => {
  const content = {
    title: "Tech Weekly Insights",
    issue: "Issue #42 - February 2025",
    sections: [
      {
        id: 1,
        type: "featured",
        title: "AI Breakthrough in Healthcare",
        content: "A groundbreaking development in AI-powered diagnostics has shown promising results in early disease detection. The new system demonstrates 95% accuracy in identifying potential health risks through routine blood tests.",
        importance: "high"
      },
      {
        id: 2,
        type: "industry",
        title: "Market Trends",
        content: "The tech sector continues to evolve rapidly. This week saw major developments in quantum computing, with several startups announcing significant breakthroughs in qubit stability. These advances could accelerate the timeline for practical quantum applications.",
        bulletPoints: [
          "Quantum computing investments up 40%",
          "New semiconductor facilities announced",
          "Cloud services market expands"
        ]
      },
      {
        id: 3,
        type: "analysis",
        title: "Expert Analysis",
        content: "The convergence of AI and quantum computing presents unique opportunities and challenges. Industry experts suggest that the next five years will be crucial in determining the direction of these technologies. Security remains a top concern as systems become more sophisticated.",
        expertName: "Dr. Lisa Chen",
        expertise: "Quantum Computing Specialist"
      },
      {
        id: 4,
        type: "upcoming",
        title: "Upcoming Events",
        events: [
          {
            name: "Global Tech Summit",
            date: "March 15-17",
            location: "Virtual"
          },
          {
            name: "AI Ethics Workshop",
            date: "March 22",
            location: "London"
          },
          {
            name: "Developer Conference",
            date: "April 5-7",
            location: "San Francisco"
          }
        ]
      },
      {
        id: 5,
        type: "resources",
        title: "Further Reading",
        links: [
          "Complete Guide to Quantum Computing",
          "AI Ethics Framework 2025",
          "Future of Tech Report"
        ]
      },
      {
        id: 6,
        type: "footer",
        content: "Stay ahead of the curve with our weekly insights into the rapidly evolving technology landscape. Subscribe to our premium membership for in-depth analysis and exclusive content."
      }
    ]
  };

  return (
    <div className="p-4 bg-blue-50 h-full overflow-auto">
      <article className="columns-2 gap-4">
        <header className="break-after-column mb-6">
          <h1 className="text-xl font-bold text-blue-900">{content.title}</h1>
          <p className="text-sm text-blue-600">{content.issue}</p>
        </header>

        {content.sections.map((section) => {
          switch (section.type) {
            case 'featured':
              return (
                <section 
                  key={section.id}
                  className="mb-6 break-inside-avoid break-after-column"
                >
                  <h2 className="text-lg font-semibold text-blue-800 mb-2">
                    {section.title}
                  </h2>
                  <p className="text-sm leading-relaxed text-gray-700">
                    {section.content}
                  </p>
                </section>
              );

            case 'industry':
              return (
                <section 
                  key={section.id}
                  className="mb-6 break-inside-avoid break-before-column"
                >
                  <h2 className="text-lg font-semibold text-blue-800 mb-2">
                    {section.title}
                  </h2>
                  <p className="text-sm leading-relaxed text-gray-700 mb-3">
                    {section.content}
                  </p>
                  <ul className="text-sm space-y-1 text-gray-600">
                    {section.bulletPoints.map((point, index) => (
                      <li key={index} className="break-inside-avoid">• {point}</li>
                    ))}
                  </ul>
                </section>
              );

            case 'analysis':
              return (
                <section 
                  key={section.id}
                  className="mb-6 break-inside-avoid"
                >
                  <h2 className="text-lg font-semibold text-blue-800 mb-2">
                    {section.title}
                  </h2>
                  <p className="text-sm leading-relaxed text-gray-700 mb-2">
                    {section.content}
                  </p>
                  <p className="text-xs text-blue-600">
                    By {section.expertName} - {section.expertise}
                  </p>
                </section>
              );

            case 'upcoming':
              return (
                <section 
                  key={section.id}
                  className="mb-6 break-inside-avoid break-before-column"
                >
                  <h2 className="text-lg font-semibold text-blue-800 mb-2">
                    {section.title}
                  </h2>
                  <div className="space-y-2">
                    {section.events.map((event, index) => (
                      <div key={index} className="text-sm break-inside-avoid">
                        <p className="font-medium">{event.name}</p>
                        <p className="text-xs text-gray-600">
                          {event.date} - {event.location}
                        </p>
                      </div>
                    ))}
                  </div>
                </section>
              );

            case 'resources':
              return (
                <section 
                  key={section.id}
                  className="mb-6 break-inside-avoid"
                >
                  <h2 className="text-lg font-semibold text-blue-800 mb-2">
                    {section.title}
                  </h2>
                  <ul className="text-sm space-y-1 text-blue-600">
                    {section.links.map((link, index) => (
                      <li key={index} className="break-inside-avoid">
                        → {link}
                      </li>
                    ))}
                  </ul>
                </section>
              );

            case 'footer':
              return (
                <footer 
                  key={section.id}
                  className="mt-6 break-inside-avoid break-before-column"
                >
                  <p className="text-sm text-gray-600 italic">
                    {section.content}
                  </p>
                </footer>
              );
          }
        })}
      </article>
    </div>
  );
};

export default Newsletter;

Best Practices

Maintain Design Consistency

A uniform layout enhances readability and maintains a predictable structure across various sections of a project. When applying break-inside-*, ensure that adjacent content blocks follow a consistent flow, preventing erratic visual breaks. This is particularly important in multi-column layouts, where an uncontrolled break inside a column may disrupt the expected alignment.

When designing complex layouts, use consistent spacing with utilities like p-*, or m-* to reinforce alignment. Avoid abrupt changes in break-inside behavior between sections, as this can lead to an inconsistent user experience.

Build Responsive Design

Ensuring optimal display across different screen sizes is a fundamental aspect of responsive design. When using break-inside-* utilities, responsiveness must be carefully considered to maintain a structured layout across various devices.

Use Tailwind’s responsive prefixes (sm:, md:, lg:, etc.) to allow for dynamic behavior adjustments. For example, applying break-inside-avoid lg:break-inside-auto  ensures that elements avoid breaking on smaller screens while allowing natural flow on larger screens. This strategy provides an adaptive approach where content structures remain visually consistent without unnecessary fragmentation.

Furthermore, pairing break-inside-* with columns-* enhances content distribution across screen sizes. In a multi-column layout, setting md:columns-2 lg:columns-3 in combination with break-inside-avoid ensures that text and media elements remain grouped appropriately across breakpoints.

Accessibility Considerations

Enhance Readability and Navigability

Applying break-inside-* directly impacts content readability and ease of navigation. Poorly structured breaks can disrupt the logical flow of information, making it harder for users to consume content.

To improve readability, ensure that break-inside-avoid is used in sections where content should not be fragmented, such as important paragraphs or lists. Grouping related elements together allows users to scan through content without any distractions.

Screen readers and assistive technologies also benefit from structured layouts where elements remain intact. By preventing breaks within key sections, users relying on assistive tools can navigate content more efficiently, improving accessibility for all audiences.

Focus on High Contrast

While break-inside-* primarily affects layout structure, its impact on contrast ratios should not be overlooked. When elements break unexpectedly, they may create unintentional spacing issues that affect visual clarity, especially for users with visual impairments.

Maintaining contrast by pairing break-inside-* with appropriate background and text color utilities (bg-contrast-*, text-*) enhances legibility. For example, using break-inside-avoid within a high-contrast color scheme ensures that content sections remain clearly distinguishable, preventing readability challenges.