Last modified: May 05, 2025 By Alexander Williams

Modern Plone Themes with Bootstrap & React

Plone is a powerful CMS with great flexibility. Modernizing its frontend is key for better user experience. This guide shows how to integrate Bootstrap and React.

Why Use Bootstrap and React with Plone?

Bootstrap offers responsive design out of the box. React provides dynamic UI components. Together, they enhance Plone's frontend capabilities.

Plone's REST API makes this integration smooth. Check our guide on Build RESTful APIs with Plone to understand the backend setup.

Setting Up the Development Environment

First, ensure you have Plone installed. Then install Node.js for frontend tools. Create a new Plone add-on for your theme.


# Install Plone
pip install Plone
# Create new add-on
mrbob -O plonetheme.mytheme bobtemplates.plone:theme

Integrating Bootstrap

Bootstrap can be added via CDN or npm. For better control, we recommend npm.


# In your theme directory
npm install bootstrap

Import Bootstrap in your main SCSS file:

 
// In resources/scss/theme.scss
@import "~bootstrap/scss/bootstrap";

Adding React to Plone

React works well with Plone's REST API. First, set up a basic React app in your theme.


npx create-react-app src/plonetheme/mytheme/react-app

Configure webpack to bundle React files. Use plone.static to serve them.

Connecting React to Plone API

Use axios or fetch to connect React to Plone. Here's a basic component example:

 
import React, { useEffect, useState } from 'react';
import axios from 'axios';

function ContentList() {
  const [content, setContent] = useState([]);
  
  useEffect(() => {
    axios.get('/Plone/@search')
      .then(response => setContent(response.data.items));
  }, []);

  return (
    <div className="container">
      {content.map(item => (
        <div key={item.id}>{item.title}</div>
      ))}
    </div>
  );
}

For complex queries, see our Plone Catalog Guide.

Theme Customization

Override Plone templates in your theme. Use @@view to check template names. Learn more in our View Components Guide.

Example template override structure:


plonetheme.mytheme/
└── templates/
    └── main_template.pt

Deployment Considerations

Build your React app for production before deployment. Configure Plone to serve static files.


# Build React app
npm run build

Set up proper caching headers. Use CDN for better performance.

Conclusion

Integrating Bootstrap and React modernizes Plone's frontend. It offers better UX while keeping Plone's robust backend. Start small and expand as needed.

For advanced topics, explore Custom Content Models or other guides in our documentation.