Layout
v0.2.0+
HelixUI v0.2.0 or later required
The Layouts component provides information about Helix application anatomy for the purposes of advanced customization.
Layout Templates
It is highly recommended that you use one of the pre-defined layout templates described below.
If you find that the pre-defined templates do not meet your needs, please skip ahead to Prerequisites to review documentation needed to better understand how to customize your application.
Use a vertical layout if your application content needs to grow along the y-axis.
Use a horizontal layout if your application content needs to grow across the x-axis.
Prerequisites
To get the most out of Layout documentation, developers are expected to:
- Review the instructions in the Getting Started guide.
- Have a basic understanding of the features and limitations of each of the pre-defined layouts.
Layout Anatomy
Layouts are composed of several different areas. Understanding the purpose for each area should help you locate the best place to add custom containers.
- Document Body
-
Houses all markup for a layout.
html > body
- Head
-
Reserved for cross-product, global navigation.
body > header#head
- Foot
-
Reserved for legal information.
body > footer#foot
- App Container
-
Mount point for single-page applications.
body > #app
- Stage
-
Root element for single-page applications.
#app > div#stage
- Nav
-
Houses hyperlinks to pages within an application.
#stage > nav#nav
- Main Content
-
Houses primary page content.
#stage > main#content
- Side Rail
-
Houses secondary page content.
#stage > aside.hxSiderail
Document Body
The document <body>
is the root element
for applying CSS needed for any application layout.
Add one of the following CSS classes to the <body>
element
to begin with pre-defined layout styles.
hxVertical
for a vertical layouthxHorizontal
for a horizontal layout
App Container
The app container serves as the mounting point for your single-page application.
- It must have an ID of
app
. - It can be any block element.
Stage
The stage serves as the root element required by client-side frameworks that use virtual DOM technologies (e.g., hyperscript).
The Stage can be divided into three areas:
- Nav (optional)
- Main Content
- left or right Side Rail (optional)
The stage container must have an ID of stage
.
Nav
The nav area houses hyperlinks to pages within your application.
-
It must have an ID of
nav
. -
Use a
<nav>
element to provide the best support for accessible user agents. - See the Navigation component for content information.
Main Content
The main content area houses primary page content.
-
It must have an ID of
content
. -
Use a
<main>
element to provide the best support for accessible user agents. -
Add the
role="main"
attribute to provide the best legacy support for accessible user agents.
Side Rail
The side rail houses secondary page content.
-
Use an
<aside>
element to provide the best support for accessible user agents. -
Add the
hxSiderail
CSS class to apply visual styling.