
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
bootstrap.native
Advanced tools
Native JavaScript for Bootstrap, the sweetest JavaScript library without jQuery.
bootstrap.native is a JavaScript library that provides native JavaScript components for Bootstrap, eliminating the need for jQuery. It aims to offer the same functionality as Bootstrap's JavaScript components but in a more lightweight and efficient manner.
Modal
This code demonstrates how to create and control a Bootstrap modal using bootstrap.native. It initializes a modal and sets up an event listener to show the modal when a button is clicked.
document.addEventListener('DOMContentLoaded', function() {
var myModal = new Modal(document.getElementById('myModal'));
document.getElementById('openModal').addEventListener('click', function() {
myModal.show();
});
});
Tooltip
This code demonstrates how to create a tooltip using bootstrap.native. It initializes a tooltip with a specified title and placement on a target element.
document.addEventListener('DOMContentLoaded', function() {
var tooltipTrigger = document.getElementById('tooltipTrigger');
var myTooltip = new Tooltip(tooltipTrigger, {
title: 'This is a tooltip',
placement: 'top'
});
});
Dropdown
This code demonstrates how to create a dropdown menu using bootstrap.native. It initializes a dropdown on a specified element.
document.addEventListener('DOMContentLoaded', function() {
var dropdownElement = document.getElementById('myDropdown');
var myDropdown = new Dropdown(dropdownElement);
});
Bootstrap is the original library that bootstrap.native aims to complement. It provides a comprehensive set of CSS and JavaScript tools for building responsive web applications. Unlike bootstrap.native, Bootstrap's JavaScript components rely on jQuery.
Popper.js is a library used to manage poppers in web applications. It is often used in conjunction with Bootstrap for positioning tooltips and popovers. While bootstrap.native provides a more integrated solution for Bootstrap components, Popper.js focuses specifically on positioning elements.
Tether is a JavaScript library for efficiently making an absolutely positioned element stay next to another element on the page. It is similar to Popper.js and can be used with Bootstrap for positioning tooltips and dropdowns. bootstrap.native, on the other hand, provides a more comprehensive set of Bootstrap components without the need for jQuery.
The faster, lighter and more compact set of JavaScript components for Bootstrap 5 and Bootstrap 4, developed on modern ES6+ standards. The bootstrap.native library is available on npm, CDN and comes packed with build tools and lots of goodies.
The library is around 30Kb minified (V5 38Kb) and around 10Kb gZipped. See the demo for components guidelines and examples, or the Wiki/How to use on how to use the library or create custom builds.
Please check the bootstrap.native
Wiki pages, they're updated with almost every new commit:
assets/js
folder, then use proper markup to enable BSN on your pagesimport BSN from "bootstrap.native"
npm install bootstrap.native
or mark it as dependency and take it from thereturbolinks:load
, mount
, load
and similar eventslet BSN = require "bootstrap.native"
document
and window
in scopebootstrap.native
project inception, goals and motivations.The BSN library is released under the MIT license.
FAQs
Bootstrap components build with Typescript
The npm package bootstrap.native receives a total of 274,976 weekly downloads. As such, bootstrap.native popularity was classified as popular.
We found that bootstrap.native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.