Angular UI Components Documentation
The Angular Layout allows the creation of complex layouts with panels that can be nested, resized, pinned, unpinned and closed. This guide adds the Angular Layout (jqxLayout) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxlayout 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxLayoutModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxLayoutModule } from 'jqwidgets-ng/jqxlayout';
@Component({
selector: 'app-root',
imports: [jqxLayoutModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<jqxLayout [width]="getWidth()" [height]="600" [layout]="layout">
<!--The panel content divs can have a flat structure-->
<!--autoHideGroup-->
<div data-container="ToolboxPanel">
List of tools
</div>
<div data-container="HelpPanel">
Help topics
</div>
<!--documentGroup-->
<div data-container="Document1Panel">
Document 1 content
</div>
<div data-container="Document2Panel">
Document 2 content
</div>
<!--bottom tabbedGroup-->
<div data-container="ErrorListPanel">
List of errors
</div>
<div data-container="OutputPanel">
Output
</div>
<!--right tabbedGroup-->
<div data-container="SolutionExplorerPanel">
<div id="treeContainer" style="border: none;"></div>
</div>
<div data-container="PropertiesPanel">
List of properties
</div>
</jqxLayout>
import { Component, ViewEncapsulation } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxLayoutModule } from 'jqwidgets-ng/jqxlayout';
import { jqxTreeModule } from 'jqwidgets-ng/jqxtree';
@Component({
imports: [CommonModule, jqxLayoutModule, jqxTreeModule],
selector: 'app-root',
templateUrl: './app.html',
styleUrl: './app.css',
encapsulation: ViewEncapsulation.None
})
export class App {
getWidth(): any {
if (document.body.offsetWidth < 800) {
return '90%';
}
return 800;
}
source: any[] = [
{
icon: 'https://www.jqwidgets.com/angular/images/earth.png',
label: 'Project',
expanded: true,
items: [
{
icon: 'https://www.jqwidgets.com/angular/images/folder.png',
label: 'css',
expanded: true,
items: [
{
icon: 'https://www.jqwidgets.com/angular/images/nav1.png',
label: 'jqx.base.css'
},
{
icon: 'https://www.jqwidgets.com/angular/images/nav1.png',
label: 'jqx.energyblue.css'
},
{
icon: 'https://www.jqwidgets.com/angular/images/nav1.png',
label: 'jqx.orange.css'
}
]
},
{
icon: 'https://www.jqwidgets.com/angular/images/folder.png',
label: 'scripts',
items: [
{
icon: 'https://www.jqwidgets.com/angular/images/nav1.png',
label: 'jqxcore.js'
},
{
icon: 'https://www.jqwidgets.com/angular/images/nav1.png',
label: 'jqxdata.js'
},
{
icon: 'https://www.jqwidgets.com/angular/images/nav1.png',
label: 'jqxgrid.js'
}
]
},
{ icon: 'https://www.jqwidgets.com/angular/images/nav1.png', label: 'index.htm' }
]
}
];
layout: any[] = [
{
type: 'layoutGroup',
orientation: 'horizontal',
items: [
{
type: 'autoHideGroup',
alignment: 'left',
width: 80,
unpinnedWidth: 200,
items: [
{ type: 'layoutPanel', title: 'Toolbox', contentContainer: 'ToolboxPanel' },
{ type: 'layoutPanel', title: 'Help', contentContainer: 'HelpPanel' }
]
},
{
type: 'layoutGroup',
orientation: 'vertical',
width: 500,
items: [
{
type: 'documentGroup',
height: 400,
minHeight: 200,
items: [
{
type: 'documentPanel',
title: 'Document 1',
contentContainer: 'Document1Panel'
},
{
type: 'documentPanel',
title: 'Document 2',
contentContainer: 'Document2Panel'
}
]
},
{
type: 'tabbedGroup',
height: 200,
pinnedHeight: 30,
items: [
{
type: 'layoutPanel',
title: 'Error List',
contentContainer: 'ErrorListPanel'
},
{
type: 'layoutPanel',
title: 'Output',
contentContainer: 'OutputPanel',
selected: true
}
]
}
]
},
{
type: 'tabbedGroup',
width: 220,
minWidth: 200,
items: [
{
type: 'layoutPanel',
title: 'Solution Explorer',
contentContainer: 'SolutionExplorerPanel',
initContent: () => {
jqwidgets.createInstance('#treeContainer', 'jqxTree', {
source: this.source,
height: '99%',
width: '100%'
});
}
},
{
type: 'layoutPanel',
title: 'Properties',
contentContainer: 'PropertiesPanel'
}
]
}
]
}
];
}.jqx-layout-group-auto-hide-content-vertical {
width: 200px;
}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, pin: This event is triggered when a group has been pinned.
<jqxLayout (onPin)="onPin($event)"></jqxLayout>
onPin(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, refresh: Refreshes the widget.
<jqxLayout #myLayout></jqxLayout>
import { Component, viewChild } from '@angular/core';
import { jqxLayoutModule, jqxLayoutComponent } from 'jqwidgets-ng/jqxlayout';
@Component({
selector: 'app-root',
imports: [jqxLayoutModule],
templateUrl: './app.html'
})
export class App {
readonly myLayout = viewChild.required<jqxLayoutComponent>('myLayout');
run(): void {
this.myLayout().refresh();
}
}