Skip to content

Commit acc6fb6

Browse files
committed
chore: update documentation
1 parent 867733d commit acc6fb6

2 files changed

Lines changed: 220 additions & 105 deletions

File tree

README.md

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,44 @@
44

55
# bs-elements
66

7-
A **Bootstrap 5–based, framework-agnostic Web Component library** built around the Bootstrap philosophy:<br>
8-
_class-first markup, minimal abstraction, and a thin DOM wrapper_.
7+
bs-elements is a **framework-agnostic Web Component library** built around the Bootstrap philosophy.
98

10-
bs-elements augments existing Bootstrap HTML and JavaScript with a **declarative Custom Element API**<br>
11-
— without hiding, replacing, or reinventing Bootstrap.
9+
The same HTML markup, styles, JavaScript API, and events you already know, just wrapped in a **declarative Custom Element API** — without hiding, replacing, or reinventing anything. It feels more natural, composable, and built for modern development.
1210

13-
## 🎯 Goals
11+
Use it with vanilla JS or any framework you like.
1412

15-
- Expose Bootstrap 5 components as **Custom Elements**
16-
- Work everywhere: **Vanilla JS, React, Vue, Svelte**
17-
- Preserve **full Bootstrap compatibility** (HTML, JS API, events)
18-
- Reduce boilerplate while adding behavior
13+
## ℹ️ How it works?
1914

20-
Explicitly not a goal:
15+
1. Place `bs-elements.min.js` script at the bottom of your [Bootstrap 5](https://getbootstrap.com/docs/5.3/getting-started/introduction/) page.
16+
2. Use our custom elements e.g. `<bs-modal>` instead of generic `<div>` elements.
17+
3. Skip the boilerplate parts if you want and enjoy reactivity! ✨
2118

22-
- Inventing a new design system
23-
- Replacing Bootstrap CSS
24-
- Shadow DOM isolation
25-
26-
## 🚀 Getting started
19+
```html
20+
<!doctype html>
21+
<html lang="en">
22+
<head>
23+
<meta charset="utf-8">
24+
<meta name="viewport" content="width=device-width, initial-scale=1">
25+
<title>Bootstrap demo</title>
26+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">
27+
</head>
28+
<body>
29+
30+
<bs-modal class="modal" data-bs-backdrop="static" header="Modal title" dismissible open>
31+
<p>Modal body text goes here.</p>
32+
</bs-modal>
33+
34+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
35+
<script src="https://cdn.jsdelivr.net/npm/@programmerg/bs-elements@0.1.0/dist/bs-elements.min.js"></script>
36+
</body>
37+
</html>
38+
```
2739

28-
Good old way
40+
We have different type of builds:
2941

30-
1. Follow the [official guide](https://getbootstrap.com/docs/5.3/getting-started/introduction/)
31-
2. replace `bootstrap.boundle.min.js` with our `bs-elements.boundle.min.js`<br>
32-
or keep it and add `bs-elements.min.js` next to it.
42+
- `.min.js` - standalone, minimized
43+
- `.boundle.min.js` - this also includes the bootstrap boundle
44+
- `.esm.js` - ES Module version
3345

3446
CDN links
3547

@@ -39,10 +51,22 @@ CDN links
3951
<script src="https://cdn.jsdelivr.net/npm/@programmerg/bs-elements@0.1.0/dist/bs-elements.esm.js" type="module"></script>
4052
```
4153

42-
ES Modules
54+
Package managers
55+
56+
- `npm install @programmerg/bs-elements`
57+
- `import BsElements from '@programmerg/bs-elements'`
4358

44-
- Run the `npm i @programmerg/bs-elements` command
45-
- and use `import * from '@programmerg/bs-elements'`
59+
## 🎯 Goals
60+
61+
- Expose Bootstrap 5 components as **Custom Elements**
62+
- Work everywhere: **Vanilla JS, React, Vue, Svelte**
63+
- Preserve **full Bootstrap compatibility** (HTML, JS API, events)
64+
- Reduce boilerplate while adding behavior
65+
66+
Explicitly not a goal:
67+
68+
- Inventing a new design system
69+
- Replacing Bootstrap CSS and JS
4670

4771
## 🧠 Design Principles
4872

@@ -139,7 +163,7 @@ Responsibilities:
139163

140164
**Auto boilerplate generation**
141165

142-
If required Bootstrap structure is missing, BsElements fills the gap.
166+
If required Bootstrap structure is missing, bs-elements fills the gap.
143167

144168
```html
145169
<bs-modal>

0 commit comments

Comments
 (0)