Bootstrap 4 components for Svelte v3
Work in progress, check back soon - PRs are welcome!
However, to make using Bootstrap themes easier, this library does not embed Bootstrap styles directly and you will need to include Bootstrap 4 CSS in your page.
The component names and interface are inspired by the reactstrap library for React.
- See component list below
- Some stateful components have issues
- Collapse uses the Svelte slide transistion. In Svelte, the component is removed from the DOM whereas in Bootstrap, it stays in the DOM, but is hidden. This interacts badly with nav bars on small screens.
- Modal uses Svelte fade transition, which does not use the Bootstrap theme defaults for duration, etc.
- Most components are missing general DOM events, see #36
npm install --save svelte sveltestrap
You need to include a link to Bootstrap 4 stylesheet in your page - these components do not include or embed any Bootstrap styles automatically.
Either in your HTML layout:
Or add from your Svelte app:
<svelte:head> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> </svelte:head>
In your svelte component:
Note on server-side rendering (SSR) Usage:
If you are using Sveltestrap in an SSR environment like Sapper, it's recommended you import the component source directly, for example:
Sveltestrap is currently missing support for the following components:
Please follow (or help out with) these issues for status:Missing Tooltip (#31) Missing Popover (#32)