Skip to content

Commit e6a39c9

Browse files
authored
Update README.md
1 parent e18e344 commit e6a39c9

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,31 @@ npm i neptunecss-js
1919
<script src="https://cdn.jsdelivr.net/npm/neptunecss-js@latest/neptune.min.js"></script>
2020
```
2121

22-
#### Example
22+
### Import
23+
24+
There are two ways to import Neptune JS. The first way is a namespaced import. Copy the following line into your file.
25+
26+
```javascript
27+
import * as NeptuneJS from "path/to/package/neptune.min.js"
28+
```
29+
30+
Now you have to write NeptuneJS. before every class of Neptune JS like:
31+
32+
```javascript
33+
const myBadge = new NeptuneJS.Badge({
34+
text: "default badge",
35+
size: "m",
36+
style: "primary"
37+
});
38+
```
39+
40+
The second way to import Neptune JS is to import only the components you need.
41+
42+
```javascript
43+
import { Badge, Spinner, Toast } from "path/to/package/neptune.min.js"
44+
```
45+
46+
### Example
2347
```html
2448
<!DOCTYPE html>
2549
<html lang="en">

0 commit comments

Comments
 (0)