Bootstrap 5 components for Svelte 4+
Sveltestrap is a library that simplifies the integration of Bootstrap 5 components into Svelte applications. It eliminates the need for Bootstrap component classes, the inclusion of Bootstrap’s JavaScript, and reliance on jQuery. Sveltestrap is an open-source software available under the MIT license and draws inspiration from the reactstrap library for React.
To use Sveltestrap in your Svelte application, follow these steps:
Add Bootstrap 5 CSS:
index.html
file.App.svelte
file.Add Bootstrap Icons:
App.svelte
.index.html
.Using Sapper:
Optional: If you prefer the @sveltestrap/sveltestrap
import, you can move the package to the devDependencies
block in your package.json
so that Sapper will parse the ES bundle.
Sveltestrap is a valuable library for Svelte developers looking to integrate Bootstrap 5 components into their applications. With simplified integration, elimination of component classes and reliance on jQuery, and support for Bootstrap Icons, Sveltestrap offers an efficient and effective solution for incorporating Bootstrap’s features into Svelte projects.