GrapesJS Bootstrap Plugin
A comprehensive plugin for GrapesJS that integrates Bootstrap 5 components and functionality to create responsive websites with minimal effort.
Features
- Bootstrap 5 components integration
- Responsive grid system
- Pre-built content blocks and templates
- Custom styling options
- Bootstrap-specific traits and commands
- Interactive advanced components
Installation
npm install grapesjs-bootstrap
Usage
import grapesjs from 'grapesjs';
import grapesjsBootstrap from 'grapesjs-bootstrap';
const editor = grapesjs.init({
container: '#gjs',
plugins: [grapesjsBootstrap],
pluginsOpts: {
grapesjsBootstrap: {
// Options
componentPrefix: 'bs-', // Optional prefix for component classes
}
}
});
Available Components
Our plugin currently offers the following pre-built components:
Content Blocks
Hero Section
- Responsive header section with compelling headline
- Image and text content areas
- Call-to-action button
Alternative Hero
- Centered text layout with dual call-to-action buttons
- Feature highlights with icons
- Clean, modern design
Features Section
- Icon-based feature highlights
- Customizable content for each feature
- Responsive column layout
Alternative Features
- Horizontal icon and text layout
- Two-column responsive grid
- Call-to-action button
- Modern left-aligned design
Products Grid
- Responsive product cards
- Customizable product information
- Call-to-action buttons
Enhanced Products Grid
- Four-column responsive layout
- Product ratings and review counts
- Sale and new item badges
- Dual action buttons for details and purchase
- Flexible product information display
Team Section
- Team member profiles with images
- Customizable member information
- Social media integration
Leadership Team
- Horizontal card layout with side-by-side images
- Detailed professional descriptions
- Role-based categorization
- Social media and contact links
- Call-to-action button
Pricing Tables
- Multi-tier pricing options
- Feature list for each tier
- Highlighted recommended plan
- Call-to-action buttons
Modern Pricing Table
- Billing toggle (monthly/annual)
- Visual feature comparison with icons
- Detailed plan descriptions
- Full-width call-to-action buttons
- Hover effects and clean design
Testimonials
- Client feedback cards
- Customizable profile pictures and content
- Clean, professional layout
Enhanced Testimonials
- Star ratings display
- Client and company logos
- Detailed testimonial content
- Social proof section with partner logos
- Modern card design with shadows
FAQ Section
- Accordion-style question and answer format
- Expandable sections
- Easy content customization
Enhanced FAQ
- Two-column layout with left-side introduction
- Contact support option
- Styled accordion items with shadow effects
- Rich content formatting with lists and paragraphs
- Additional resources links
Advanced Components
Progress Bar
- Interactive progress indicator
- Customizable colors and styles
- Configurable progress percentage
- Optional text display
- Striped and animated variations
Timeline
- Interactive timeline for showcasing chronological events
- Vertical and horizontal layout options
- Multiple alignment styles (alternate, left, right)
- Customizable colors and icons
- Smooth reveal animations
- Add/edit/delete timeline events
- Responsive design for all devices
Carousel
- Interactive Bootstrap 5 image carousel
- Add and customize multiple image slides
- Caption editing for each slide
- Configurable options: autoplay, indicators, controls
- Custom time interval settings
- Fade transition effects
- Responsive on all devices
- User-friendly image management
Component Customization
Each component supports various customization options through the GrapesJS Traits panel:
- Background colors and styles
- Content editing
- Spacing and layout modifications
- Bootstrap-specific classes and utilities
Development
Setup
- Clone the repository
- Install dependencies:
npm install
- Start development server:
npm run start
Project Structure
/src
/components # Bootstrap component definitions
/content # Content-focused components
/advanced # Advanced interactive components
/blocks # Pre-built blocks
/content # Content block definitions
/advanced # Advanced block definitions
index.js # Plugin entry point
Building
npm run build
Configuration Options
Option |
Type |
Default |
Description |
componentPrefix |
String |
'bs-' |
Prefix for component classes |
defaultStyles |
Boolean |
true |
Whether to load default Bootstrap styles |
Future Extensible Blocks
We plan to expand the plugin with the following component categories:
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT
Support
For support and questions, please open an issue in the repository.
"# grapesjs-bootstrap5"