ForgeComponents
en

Components

j-NavLayout

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

A simple and fully responsive navigation layout.


Good to know:

  • path {Boolean} shows the navigation panel in display modes defined in the hide config option
  • <section> must contain a navigation
  • <main> must contain a content

Configuration:

  • width {Number} a size of navigation (default: 250)
  • hide {String} hides navigation in defined display modes (default: xs,sm)
  • autoresize {Boolean} enables auto-resizing (default: true)
  • position {String} navigation position (default: left)
  • margin {Number} adds margin for height (default: 0)
  • parent {String} can contain parent, window or jQuery selector for the closest method (default: window)

Use it with <ui-component name="navlayout">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<style>
	html, body { margin: 0; padding: 0; }
</style>

<ui-component name="navlayout" path="common.menu" config="parent:window;hide:xs" class="invisible">

	<section style="background-color:blue;color:#FFF">
		Navigation
	</section>

	<main style="background-color:red;color:#FFF">
		Main body
	</main>

</ui-component>

<script>

	var common = { menu: false };

	setInterval(function() {
		var path = 'common.menu';
		SET(path, !GET(path));
	}, 3000);

</script>