Skip to content
PatternFly logo

Sidebar

Examples

Basic

Sidebar panel

Default layout.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Gutter

Sidebar panel. Adding some extra content so that the gap between the panel and content area is better illustrated in this example.

Adds a gutter between the panel and content when in the split layout.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Stack

Sidebar panel

Forces a stacked layout.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Split

Sidebar panel

Forces a split layout.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Panel right (HTML)

Moves the panel to the right by placing the panel after the content in the HTML.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Sidebar panel

Panel right (modifier)

Sidebar panel

Moves the panel to the right via the modifier class .pf-m-panel-right on the sidebar component.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Sticky panel

Sidebar panel

Forces the panel to be sticky to the top of the layout.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Static panel

Sidebar panel

Forces the panel to be statically positioned (not sticky).

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Responsive panel width

Sidebar panel

Changes the panel with and can change responsively at different breakpoints.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus nulla id augue dictum commodo. Donec mollis arcu massa, sollicitudin venenatis est rutrum vitae. Integer pulvinar ligula at augue mollis, ac pulvinar arcu semper. Maecenas nisi lorem, malesuada ac lectus nec, porta pretium neque. Ut convallis libero sit amet metus mattis, vel facilisis lorem malesuada. Duis consectetur ante sit amet magna efficitur, a interdum leo vulputate.

Praesent at odio nec sapien ultrices tincidunt in non mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis consectetur nisl quis facilisis faucibus. Sed eu bibendum risus. Suspendisse porta euismod tortor, at elementum odio suscipit sed. Cras eget ultrices urna, ac feugiat lectus. Integer a pharetra velit, in imperdiet mi. Phasellus vel hendrerit velit. Vestibulum ut augue vitae erat vulputate bibendum a ut magna.

Documentation

Usage

Class
Applied to
Outcome
.pf-c-sidebar
<div>
Initiates the sidebar component. Required
.pf-c-sidebar__main
<div>
Initiates the sidebar main element. Required
.pf-c-sidebar__panel
<div>
Initiates the sidebar panel element. Required
.pf-c-sidebar__content
<div>
Initiates the sidebar content element. Required
.pf-m-gutter
.pf-c-sidebar
Modifies the sidebar component to add a gutter between the panel and content.
.pf-m-stack
.pf-c-sidebar
Modifies the sidebar to stack the panel on top of the content.
.pf-m-split
.pf-c-sidebar
Modifies the sidebar to position the panel and content side by side.
.pf-m-panel-right
.pf-c-sidebar
Modifies the sidebar to place the panel to the right of the content.
.pf-m-sticky
.pf-c-sidebar__panel
Modifies the panel to be sticky to the top of the layout.
.pf-m-static
.pf-c-sidebar__panel
Modifies the panel to be positioned statically.
.pf-m-width-{default, 25, 33, 50, 66, 75, 100}{-on-[breakpoint]}
.pf-c-sidebar__panel
Modifies the panel width at optional breakpoint. Note: does not apply when the panel is stacked on top of the content.
.pf-m-no-background
.pf-c-sidebar, .pf-c-sidebar__panel, .pf-c-sidebar__content
Modifies the element to have a transparent background.

CSS variables

.pf-c-sidebar--pf-c-sidebar--BackgroundColor
#fff
.pf-c-sidebar--pf-c-sidebar__main--FlexDirection
column
.pf-c-sidebar--pf-c-sidebar__main--md--FlexDirection
row
.pf-c-sidebar--pf-c-sidebar__main--AlignItems
stretch
.pf-c-sidebar--pf-c-sidebar__main--md--AlignItems
start
.pf-c-sidebar--pf-c-sidebar__main--child--MarginTop
0
.pf-c-sidebar--pf-c-sidebar__main--child--MarginLeft
0
.pf-c-sidebar--pf-c-sidebar--m-gutter__main--Gap
1rem
.pf-c-sidebar--pf-c-sidebar--m-gutter__main--xl--Gap
1.5rem
.pf-c-sidebar--pf-c-sidebar--m-panel-right__panel--Order
0
.pf-c-sidebar--pf-c-sidebar--m-panel-right__panel--md--Order
1
.pf-c-sidebar--pf-c-sidebar--m-stack__main--FlexDirection
column
.pf-c-sidebar--pf-c-sidebar--m-stack__main--AlignItems
stretch
.pf-c-sidebar--pf-c-sidebar--m-stack__panel--Position
sticky
.pf-c-sidebar--pf-c-sidebar--m-stack__panel--Top
0
.pf-c-sidebar--pf-c-sidebar--m-stack__panel--BoxShadow
0 0.25rem 0.25rem -0.25rem rgba(3, 3, 3, 0.16)
.pf-c-sidebar--pf-c-sidebar--m-stack--m-panel-right__panel--Order
0
.pf-c-sidebar--pf-c-sidebar--m-split__main--AlignItems
start
.pf-c-sidebar--pf-c-sidebar--m-split__main--FlexDirection
row
.pf-c-sidebar--pf-c-sidebar--m-split__panel--Position
static
.pf-c-sidebar--pf-c-sidebar--m-split__panel--Top
auto
.pf-c-sidebar--pf-c-sidebar--m-split--m-panel-right__panel--Order
1
.pf-c-sidebar--pf-c-sidebar__panel--FlexBasis-base
auto
.pf-c-sidebar--pf-c-sidebar__panel--BoxShadow--base
0 0.25rem 0.25rem -0.25rem rgba(3, 3, 3, 0.16)
.pf-c-sidebar--pf-c-sidebar__panel--BoxShadow
0 0.25rem 0.25rem -0.25rem rgba(3, 3, 3, 0.16)
.pf-c-sidebar--pf-c-sidebar__panel--Top
0
.pf-c-sidebar--pf-c-sidebar__panel--md--Top
auto
.pf-c-sidebar--pf-c-sidebar__panel--Position
sticky
.pf-c-sidebar--pf-c-sidebar__panel--md--Position
static
.pf-c-sidebar--pf-c-sidebar__panel--FlexBasis
auto
.pf-c-sidebar--pf-c-sidebar__panel--md--FlexBasis
15.625rem
.pf-c-sidebar--pf-c-sidebar__panel--m-split--FlexBasis
15.625rem
.pf-c-sidebar--pf-c-sidebar__panel--m-stack--FlexBasis
auto
.pf-c-sidebar--pf-c-sidebar__panel--ZIndex
100
.pf-c-sidebar--pf-c-sidebar__panel--Order
0
.pf-c-sidebar--pf-c-sidebar__panel--BackgroundColor
#fff
.pf-c-sidebar--pf-c-sidebar__content--BackgroundColor
#fff
.pf-c-sidebar--pf-c-sidebar__panel--m-sticky--Top
0
.pf-c-sidebar--pf-c-sidebar__panel--m-sticky--Position
sticky
.pf-c-sidebar.pf-m-gutter--pf-c-sidebar__main--child--MarginTop
1rem
.pf-c-sidebar.pf-m-gutter--pf-c-sidebar__main--child--MarginLeft
0
.pf-c-sidebar.pf-m-panel-right--pf-c-sidebar__panel--Order
0
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__main--FlexDirection
column
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__main--AlignItems
stretch
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__main--child--MarginTop
1rem
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__main--child--MarginLeft
0
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__panel--Position
sticky
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__panel--Top
0
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__panel--BoxShadow
0 0.25rem 0.25rem -0.25rem rgba(3, 3, 3, 0.16)
.pf-c-sidebar.pf-m-stack--pf-c-sidebar__panel--FlexBasis
auto
.pf-c-sidebar.pf-m-stack--pf-c-sidebar--m-panel-right__panel--Order
0
.pf-c-sidebar.pf-m-split--pf-c-sidebar__main--FlexDirection
row
.pf-c-sidebar.pf-m-split--pf-c-sidebar__main--AlignItems
start
.pf-c-sidebar.pf-m-split--pf-c-sidebar__main--child--MarginTop
0
.pf-c-sidebar.pf-m-split--pf-c-sidebar__main--child--MarginLeft
1rem
.pf-c-sidebar.pf-m-split--pf-c-sidebar__panel--Position
static
.pf-c-sidebar.pf-m-split--pf-c-sidebar__panel--Top
auto
.pf-c-sidebar.pf-m-split--pf-c-sidebar__panel--BoxShadow
none
.pf-c-sidebar.pf-m-split--pf-c-sidebar__panel--FlexBasis
15.625rem
.pf-c-sidebar.pf-m-split--pf-c-sidebar--m-panel-right__panel--Order
1
.pf-c-sidebar__panel.pf-m-sticky--pf-c-sidebar__panel--Position
sticky
.pf-c-sidebar__panel.pf-m-sticky--pf-c-sidebar__panel--Top
0
.pf-c-sidebar__panel.pf-m-static--pf-c-sidebar__panel--Position
static
.pf-c-sidebar__panel.pf-m-static--pf-c-sidebar__panel--Top
auto
.pf-c-sidebar__content.pf-m-no-background--pf-c-sidebar__content--BackgroundColor
transparent
.pf-c-sidebar__panel.pf-m-width-default--pf-c-sidebar__panel--FlexBasis
auto
.pf-c-sidebar__panel.pf-m-width-25--pf-c-sidebar__panel--FlexBasis
25%
.pf-c-sidebar__panel.pf-m-width-33--pf-c-sidebar__panel--FlexBasis
33%
.pf-c-sidebar__panel.pf-m-width-50--pf-c-sidebar__panel--FlexBasis
50%
.pf-c-sidebar__panel.pf-m-width-66--pf-c-sidebar__panel--FlexBasis
66%
.pf-c-sidebar__panel.pf-m-width-75--pf-c-sidebar__panel--FlexBasis
75%
.pf-c-sidebar__panel.pf-m-width-100--pf-c-sidebar__panel--FlexBasis
100%

View source on GitHub