Bootstrap 4 UI Kit with Custom Components and Templates - Shards
A Bootstrap 4 UI kit with 11 custom components and two page templates, suitable for developers building responsive web interfaces.
By DesignRevision designrevision/shards-ui 1,709 stars
Introduction
Shards is a free UI kit built on top of Bootstrap 4. It provides a collection of custom components and two ready‑made page templates. The kit is responsive and works in modern browsers. It is released under the MIT license.
What this project offers
- 11 custom UI components that extend Bootstrap’s base styles.
- Two page templates (Agency Landing and App Promo) that demonstrate how to use the components.
- Additional demo page (
shards-demo.html) showing component usage. - Pre‑compiled CSS and JavaScript files ready for inclusion in a web page.
Main features
- Built on Bootstrap 4.1.3 (compatible with Bootstrap 4).
- Includes a date‑picker component (via bootstrap‑datepicker).
- Includes a slider component (via noUiSlider).
- Fully responsive layout.
- Minified CSS and JS files for production use.
Technology stack
- Framework: Bootstrap 4
- Languages: HTML, SCSS, JavaScript
- Build tools (included for developers): node‑sass, webpack, postcss, clean‑css, uglify‑js
- Dependencies: jQuery, Popper.js, bootstrap-datepicker, noUiSlider, Material Icons, Font Awesome
Requirements
- A web browser that supports HTML5 and CSS3.
- Bootstrap 4.1.3 (the kit’s CSS expects this version).
- jQuery and Popper.js if you want to use the JavaScript components.
Installation
These steps assume you have downloaded the ZIP file shards-ui.zip from the project’s release page.
- Extract the archive
unzip shards-ui.zip -d shards-ui
- Navigate to the extracted folder
cd shards-ui
- Open a demo page in the browser (any of the HTML files in
dist/can be used)
# On macOS
open dist/shards-demo.html
# On Linux
xdg-open dist/shards-demo.html
# On Windows (PowerShell)
start dist\shards-demo.html
The page will display the UI kit’s components and templates.
- Optional – serve the files locally (useful for testing relative URLs)
# If you have Python 3 installed
python -m http.server 8000 --directory dist
Then open http://localhost:8000/shards-demo.html in your browser.
- Deploy to a web host
- Upload the entire
dist/folder to the root (or a sub‑folder) of your web server. - Reference the CSS and JS files from your HTML pages, for example:
- Upload the entire
No additional build step is required for using the pre‑compiled files; the dist/ directory already contains ready‑to‑use assets.
Configuration
The kit does not require configuration to work. If you need to change the Bootstrap version or customize the SCSS, you would have to rebuild the assets (see the “Customizing the project” section). For normal use, just include the CSS and JS files from dist/.
Customizing the project
Developers who want to modify the appearance or add new components can edit the SCSS source files located in src/scss/. After making changes, run the following npm scripts to rebuild the assets:
npm install # install development dependencies
npm run css # compile and minify SCSS to dist/css/
npm run js # bundle JavaScript to dist/js/
The compiled files will replace the existing ones in dist/. The project uses node-sass for SCSS compilation, postcss with Autoprefixer for vendor prefixes, and uglify-js for JavaScript minification.
Project structure
ATTRIB.md
CHANGELOG.md
CONTRIBUTING.md
ISSUE_TEMPLATE.md
LICENSE
README.md
build/
postcss.config.js
webpack.config.js
dist/
agency-landing.html
app-promo.html
shards-demo.html
css/
shards.css
shards.min.css
shards-demo.css
shards-demo.min.css
shards-extras.css
shards-extras.min.css
images/
(image assets)
js/
shards.js
shards.min.js
demo.js
demo.min.js
src/
extras/
agency-landing.html
app-promo.html
shards-demo.html
images/
js/
scss/
js/
index.js
sliderPlugin.js
scss/
(individual component SCSS files)
shards.scss
package.json
package-lock.json
logo.jpg
Tips
- Use the minified files (
shards.min.cssandshards.min.js) in production for better performance. - Keep the original
dist/files unchanged; place any custom CSS after the Shards stylesheet to override defaults. - When adding new pages, copy one of the existing HTML files from
dist/as a starting point and adjust the content as needed. - If you need RTL support or dark mode, you will have to implement those styles manually, as the kit does not provide them.
License and attribution
Shards is released under the MIT License. See the full license file at LICENSE.
Original repository: https://github.com/designrevision/shards-ui
When redistributing Shards, keep the LICENSE file intact and credit the original author (DesignRevision).
Use this prompt with an AI coding assistant (Claude Code, Cursor, ChatGPT and similar) to add Shards to a website or app you already have.
- Download the ZIP and put the project next to your own code.
- Fill in the bracketed parts, such as
[describe your stack]. - Paste the prompt into your assistant and review each change it proposes.
# Integrate Shards **Role** You are a senior frontend developer assisting me in adding the Shards UI kit to my existing web application. **Project description** Shards is a UI kit built on Bootstrap 4. It provides 11 custom components, two page templates, a datepicker, a slider, and responsive design. The kit includes compiled CSS/JS files, demo HTML pages, and supporting images. **Source project** - Repository: https://github.com/designrevision/shards-ui - License: MIT - Base framework: Bootstrap 4 (requires Bootstrap 4.3.1) - Build tooling (used in the source, not required for integration): npm scripts, node‑sass, postcss, webpack 3.11.0, clean‑css, uglify‑js, copyfiles. - Dependencies listed in `package.json`: - `bootstrap` 4.1.3 (runtime) - `bootstrap-datepicker` ^1.8.0 (optional, for datepicker component) - `nouislider` ^11.1.0 (optional, for slider component) - `jquery` (required by Bootstrap JS and Shards JS) - `popper.js` (required by Bootstrap JS) **Target project context** - Stack: `[describe your stack, e.g., Laravel 11 + Blade]` - UI insertion point: `[where the UI should go, e.g., main layout file or a specific view]` - Existing CSS framework: `[e.g., Tailwind, Bootstrap 5, none]` **Integration objectives** - Add Shards’ custom components (alerts, badges, cards, navbars, etc.) to the existing UI. - Optionally reuse one of the two page templates (agency‑landing or app‑promo) as a new page. - Enable datepicker and slider components if the application needs them. - Keep the existing look and feel of the application while extending it with Shards styles. **Required components** - CSS: `dist/css/shards.min.css` (core styles) and optionally `shards-extras.min.css` for extra components. - JavaScript: `dist/js/shards.min.js` (core behavior). - Demo HTML pages for reference: `dist/agency-landing.html`, `dist/app-promo.html`, `dist/shards-demo.html`. - Images used by the templates: files under `dist/images/…`. **Layout and styling requirements** - Ensure Bootstrap 4 is loaded before Shards CSS. - If the target already uses Bootstrap 4, avoid loading it twice; otherwise include the required version. - To prevent style clashes, consider scoping Shards CSS to a wrapper class (e.g., `<div class="shards-ui">…</div>`) or using CSS custom properties to override conflicting variables. - Do not modify Shards source SCSS; use the compiled CSS files. **Asset management** - Copy the following files into the project’s static assets folder (adjust paths as needed): - `dist/css/shards.min.css` → `public/css/shards.min.css` - `dist/css/shards-extras.min.css` (optional) → `public/css/shards-extras.min.css` - `dist/js/shards.min.js` → `public/js/shards.min.js` - All images from `dist/images/` → `public/images/shards/` - Alternatively, reference them via CDN: - CSS: `https://unpkg.com/shards-ui@latest/dist/css/shards.min.css` - JS: `https://unpkg.com/shards-ui@latest/dist/js/shards.min.js` - Do not duplicate Bootstrap files if they are already present in the target project. **Routing and navigation** - Map the demo pages to existing routes if you want to expose them, e.g., `/demo/agency-landing` → copy `dist/agency-landing.html` into a view/template and register the route. - Keep current URLs unchanged; add new routes only for the pages you import. **Responsive requirements** - Shards is fully responsive; ensure the viewport meta tag is present (``). - Test components on typical breakpoints (mobile, tablet, desktop) after integration. **Accessibility requirements** - Shards components follow Bootstrap’s accessibility patterns. Verify that ARIA attributes are preserved when customizing components. - Test keyboard navigation for interactive elements (modals, dropdowns, sliders). **Compatibility requirements** - Bootstrap version: 4.3.1 (source uses 4.1.3, but the kit is compatible with 4.x). - jQuery version: any 3.x compatible with Bootstrap 4. - No additional build step is required for integration if you use the pre‑compiled files. If you prefer to rebuild from source, run `npm install` then `npm run css` and `npm run js` to generate the `dist/` assets. **Preserve the existing application** - First, inspect the current codebase. Do not modify authentication, routing, state management, or data layers. - Make only small, isolated changes: add CSS/JS links, create new component files, or add new view templates. - Review each change before committing. Ask before deleting any existing files. **Testing and verification checklist** - [ ] Confirm Bootstrap 4 is loaded before Shards CSS. - [ ] Verify Shards CSS and JS files are correctly referenced (local or CDN). - [ ] Check that a Shards component (e.g., a card or alert) renders with expected styling. - [ ] Test datepicker and slider components if they are used. - [ ] Ensure existing site styles are not overridden unintentionally. - [ ] Validate responsive behavior at mobile, tablet, and desktop widths. - [ ] Run accessibility checks (ARIA roles, keyboard navigation). - [ ] Verify that new routes/pages load without breaking existing navigation. - [ ] Confirm no duplicate Bootstrap or jQuery instances are loaded. - [ ] Run the application’s existing test suite to ensure nothing else regressed.




