https://github.com/grapesjs/components-navbar
Simple navbar component for the GrapesJS editor
https://github.com/grapesjs/components-navbar
Last synced: about 1 year ago
JSON representation
Simple navbar component for the GrapesJS editor
- Host: GitHub
- URL: https://github.com/grapesjs/components-navbar
- Owner: GrapesJS
- License: bsd-3-clause
- Created: 2017-07-13T18:19:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T11:16:27.000Z (almost 2 years ago)
- Last Synced: 2025-04-10T03:52:31.418Z (about 1 year ago)
- Language: TypeScript
- Size: 197 KB
- Stars: 37
- Watchers: 3
- Forks: 49
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GrapesJS Navbar
Simple navbar component for GrapesJS editor

# [Demo](http://grapesjs.com/demo.html)
## Summary
* Plugin name: `grapesjs-navbar`
* Blocks: `navbar`
* Components:
* `navbar`, `navbar-container`, `navbar-nav-menu`, `navbar-nav-menu-link`, `navbar-burger-menu`, `navbar-burger-menu-line`
## Options
| Option | Description | Default |
|-|-|-
| `id` | The ID used to create the block and component. | `navbar` |
| `label` | The label used for the block and the component. | `Navbar` |
| `block` | Object to extend the default block, eg. `{ category: 'Extra', ... }`. Pass a falsy value to avoid adding the block. | `{}` |
| `style` | Custom CSS styles for the component. This will replace the default one. | `''` |
| `styleAdditional` | Additional CSS styles for the component. These will be appended to the default one. | `''` |
| `classPrefix` | Component class prefix. | `navbar` |
## Download
* CDN
* `https://unpkg.com/grapesjs-navbar`
* NPM
* `npm i grapesjs-navbar`
* GIT
* `git clone https://github.com/GrapesJS/components-navbar.git.git`
## Usage
Directly in the browser
```html
var editor = grapesjs.init({
container : '#gjs',
plugins: ['grapesjs-navbar'],
pluginsOpts: {
'grapesjs-navbar': {/* ...options */}
}
});
```
Modern javascript
```js
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-navbar';
const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [plugin],
pluginsOpts: {
[plugin]: { /* options */ }
}
// or
plugins: [
editor => plugin(editor, { /* options */ }),
],
});
```
## Development
Clone the repository
```sh
$ git clone https://github.com/GrapesJS/components-navbar.git.git
$ cd grapesjs-navbar
```
Install it
```sh
$ npm i
```
Start the dev server
```sh
$ npm start
```
Build before the commit. This will also increase the patch level version of the package
```sh
$ npm run build
```
## License
BSD 3-Clause