Toolbar
Toolbars provide access to functions related to a single screen or container within a screen. They may appear in Tables, Panels, and other content containers where complex functionality is needed to manipulate data and content.
Icon Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
Duis elit laborum cupidatat do cillum nulla est culpa elit cillum culpa in culpa velit nisi commodo commodo sit Duis magna irure anim enim nisi mollit sit et enim adipisicing aute sed proident consequat proident ullamco consectetur fugiat dolore culpa deserunt veniam eu magna dolor proident tempor aliqua dolor officia enim.
When to Use
- Use when a set of actions are needed within the context of a page, panel, table, tab set
- Use icons when their meaning is understood by users and space is at a premium.
When Not to Use
- Do not use for navigation or links; the toolbar is reserved for actions.
Examples
- Icon Example (shown above)
- Limited Horizontal Space Icon Example
- Text Example
- Limited Horizontal Space Text Example
Usage
Text vs Icon Controls
- Use text labels or icons (but not both) in the context of the visible toolbar controls.
- Text may be combined with icons in the “more actions” menu. When present, the “more actions” menu appears on the far right.
- When text and icons are combined in the “more actions” menu, the icons are right-aligned within the popover.
Display and Behavior
- Display a maximum of 4-6 actions within the visible portion of the toolbar (on large/xl screens). This will scale down on smaller resolutions and controls will shift into the “more actions” menu as available horizontal space decreases.
- By default, the toolbar will prioritize the visibility of controls starting from the left. You may also override this behavior by using the
[data-priority]
property to ensure high-priority element are collapsed last, regardless of their order in the toolbar items. You can override the default ordering of items by applying a[data-order]
integer value. - The above order is maintained unless an item is too large to fit in the remaining space, then it will skip to the next item to fit as many items as possible.
- The toolbar dynamically fits as many controls as possible into the visible container until the small breakpoint is reached, where all items will be placed into the “more actions” menu.
- In examples it is shown alongside a title with vertical-centering but can used completely stand-alone.
Level of Actions
- A control may prompt an action to occur immediately OR it may display a series of additional actions in a Popover menu or Modal.
- When expanded, the “view more” menu displays a single level of actions. Each action within this menu may expand to display a second level of sub-actions. Additional levels beyond two should be handled via a modal window accessed from the toolbar.
Examples
Limited Horizontal Space Icon Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
Text Button Toolbar
This toolbar use only text buttons in the visible portion. Icons may be included alongside the text in the “more actions” menu.
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
When to Use
- When your descriptive labels are more important than conserving space, and horizontal space is plentiful.
- Use if toolbar actions require a descriptive label to understand what the action does
When Not to Use
- Do not use if horizontal space is limited
Additional Guidelines
- For semantic markup, an H5 may be required for the heading alongside a Text Button Toolbar. In these instances, CSS should be used to change the visual style of the heading to resemble an H4 or higher, as the H5 font style lacks visual distinction from the actionable elements in the toolbar.
Limited Horizontal Space Text Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
Developer Notes
- You can switch to the Icon Toolbar by adding the class
spark-toolbar--icon
to the.spark-toolbar
element. - You can selectively give toolbar items a Tooltip, the tooltip will not be displayed for items inside the show-more dropdown.
- You can set the contents of a dropdown to close the dropdown (and the show-more menu) by giving whichever element should close the dropdown the class
spark-toolbar__item--close-on-click
. - Toolbar items that do not have
.spark-toolbar__item--content
will cause the show-more menu to close when they are selected. - Any content can be placed inside the
.spark-toolbar__item--content
, but the width for these dropdowns are fixed at24rem
, with a default2rem 1rem
padding applied when using aul.spark-toolbar__list
or.spark-toolbar__item--content__container
. The recommended default dropdown would be adiv.spark-toolbar__item--content.spark-toolbar__item--content__container
. - A styled checkbox list is also available when using a
ul.spark-toolbar__list.spark-toolbar__list--checkboxes
inside, or as, the.spark-toolbar__item--content
. - Calling the
change()
function on the Toolbar instance will cause a recalculation of the toolbar, you should call this function after programmatically adding, removing, or modifying the toolbar’s items or styling. - You can optionally specify a
[data-priority]
integer property on.spark-toolbar__item
s that will determine the order in which toolbar items should be collapsed into the show-more menu. Higher priority values will be collapsed last. - You can optionally specify an
[data-order]
integer property on.spark-toolbar__item
s that will determine the order in which toolbar items are ordered. When initialized the original order in the document is set as the default ordering. When adding.spark-toolbar__item
s programmatically, then using thechange()
function to recalculate appearance, the new items will default to the front of the list, unless specified using.spark-toolbar__item[data-order]
property.
The following options may be passed when using new Spark.Toolbar(el, {});
:
Name | Type | Default | Description |
---|---|---|---|
onClick | function | noop() | A callback function run when a Toolbar item is clicked. Callback arguments are toolbarItemEl , instance . |
For all available methods and full API, refer to the component code on Bitbucket.
Panel Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
Duis elit laborum cupidatat do cillum nulla est culpa elit cillum culpa in culpa velit nisi commodo commodo sit Duis magna irure anim enim nisi mollit sit et enim adipisicing aute sed proident consequat proident ullamco consectetur fugiat dolore culpa deserunt veniam eu magna dolor proident tempor aliqua dolor officia enim.
<div class="container">
<div class="spark-toolbar-example">
<div class="spark-panel spark-panel--card">
<div class="spark-panel__content">
<div class="row">
<div class="col-xs-10 col-md-6">
<h3>Heading</h3>
</div>
<div class="col-xs-2 col-md-6">
<div class="spark-toolbar spark-toolbar--icon" role="menubar" tabindex="0">
<div class="spark-toolbar__container--visible">
<div class="spark-toolbar__item" label="Filter Results" aria-label="Filter Results" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content spark-toolbar__item--content__container ">
<h6>Number of Tickets</h6>
<div class="spark-slider--integrated">
<input type="number" min="1" max="30" value="4">
<div class="spark-slider__controls">
<button class="spark-slider__handle"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
<h6>Price Per Ticket</h6>
<div class="spark-range-slider">
<input type="number" min="1" max="5000" value="100" title="Start">
<span class="spark-range-slider__input-divider"></span>
<input type="number" min="1" max="5000" value="3000" title="End">
<div class="spark-slider__controls">
<button class="spark-slider__handle" title="Start"></button>
<button class="spark-slider__handle" title="End"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
</div>
<div class="spark-icon-sliders spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="View Map" aria-label="View Map" role="menuitem" tabindex="-1">
<div class="spark-icon-map spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Share Your Journey" aria-label="Share Your Journey" role="menuitem" tabindex="-1">
<div class="spark-icon-share spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Settings" aria-label="Settings" data-priority="3" data-order="1" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content">
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Save Results</li>
<li tabindex="0">Export to Excel</li>
<li tabindex="0">Create an Alert</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Modify Search</li>
<li tabindex="0">Advanced Search</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__list--checkboxes" role="menu">
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Airline</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" checked="checked" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Departure Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Arrival Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Price</span>
</label>
</li>
</ul>
</div>
<div class="spark-icon-cog spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Hotel" aria-label="Find a Hotel" role="menuitem" tabindex="-1">
<div class="spark-icon-hotel-bed spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Rental Car" aria-label="Find a Rental Car" role="menuitem" tabindex="-1">
<div class="spark-icon-car-rental spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Print Journey Summary" aria-label="Print Journey Summary" role="menuitem" tabindex="-1">
<div class="spark-icon-print spark-toolbar__item-helper"></div>
</div>
</div>
<div class="spark-toolbar__show-more" tabindex="-1">
<i class="spark-icon-menu-ellipsis-vertical"></i>
</div>
<!-- All items should be placed in .spark-toolbar__container-shown -->
<div class="spark-toolbar__container--hidden">
</div>
</div>
</div>
<div class="col-xs-12">
<hr class="spark-toolbar-example-hr"/>
</div>
<p class="col-xs-12">
Duis elit laborum cupidatat do cillum nulla est culpa elit cillum culpa in culpa velit nisi commodo commodo sit Duis magna irure anim enim nisi mollit sit et enim adipisicing aute sed proident consequat proident ullamco consectetur fugiat dolore culpa deserunt veniam eu magna dolor proident tempor aliqua dolor officia enim.
</p>
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
.spark-toolbar-example h3 {
line-height: 60px;
margin: 0;
}
.spark-toolbar-example .spark-toolbar {
position: absolute;
right: 0.5rem;
top: calc(50% - 2rem);
}
.spark-toolbar-example-hr {
margin: 1rem 0;
}
</style>
// Vanilla JS
var el = document.querySelector('.spark-toolbar');
var toolbarInstance = new Spark.Toolbar(el);
Icon Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
<div class="container">
<div class="spark-toolbar-example row">
<div class="col-xs-10 col-md-5">
<h3>Heading</h3>
</div>
<div class="col-xs-2 col-md-7">
<div class="spark-toolbar spark-toolbar--icon" role="menubar" tabindex="0">
<div class="spark-toolbar__container--visible">
<div class="spark-toolbar__item" label="Filter Results" aria-label="Filter Results" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content spark-toolbar__item--content__container ">
<h6>Number of Tickets</h6>
<div class="spark-slider--integrated">
<input type="number" min="1" max="30" value="4">
<div class="spark-slider__controls">
<button class="spark-slider__handle"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
<h6>Price Per Ticket</h6>
<div class="spark-range-slider">
<input type="number" min="1" max="5000" value="100" title="Start">
<span class="spark-range-slider__input-divider"></span>
<input type="number" min="1" max="5000" value="3000" title="End">
<div class="spark-slider__controls">
<button class="spark-slider__handle" title="Start"></button>
<button class="spark-slider__handle" title="End"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
</div>
<div class="spark-icon-sliders spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="View Map" aria-label="View Map" role="menuitem" tabindex="-1">
<div class="spark-icon-map spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Share Your Journey" aria-label="Share Your Journey" role="menuitem" tabindex="-1">
<div class="spark-icon-share spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Settings" aria-label="Settings" data-priority="3" data-order="1" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content">
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Save Results</li>
<li tabindex="0">Export to Excel</li>
<li tabindex="0">Create an Alert</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Modify Search</li>
<li tabindex="0">Advanced Search</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__list--checkboxes" role="menu">
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Airline</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" checked="checked" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Departure Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Arrival Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Price</span>
</label>
</li>
</ul>
</div>
<div class="spark-icon-cog spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Hotel" aria-label="Find a Hotel" role="menuitem" tabindex="-1">
<div class="spark-icon-hotel-bed spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Rental Car" aria-label="Find a Rental Car" role="menuitem" tabindex="-1">
<div class="spark-icon-car-rental spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Print Journey Summary" aria-label="Print Journey Summary" role="menuitem" tabindex="-1">
<div class="spark-icon-print spark-toolbar__item-helper"></div>
</div>
</div>
<div class="spark-toolbar__show-more" tabindex="-1">
<i class="spark-icon-menu-ellipsis-vertical"></i>
</div>
<!-- All items should be placed in .spark-toolbar__container-shown -->
<div class="spark-toolbar__container--hidden">
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
/* example styles */
.spark-toolbar-example {
background: #fff;
}
.spark-toolbar-example h3 {
line-height: 60px;
margin: 0;
}
.spark-toolbar-example .spark-toolbar {
position: absolute;
left: 0;
right: 0.5rem;
top: calc(50% - 2rem);
}
</style>
// Vanilla JS
var el = document.querySelector('.spark-toolbar');
var toolbarInstance = new Spark.Toolbar(el);
Limited Horizontal Space Icon Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
<div class="container">
<div class="spark-toolbar-example row">
<div class="col-xs-10 col-md-10">
<h3>Heading</h3>
</div>
<div class="col-xs-2 col-md-2">
<div class="spark-toolbar spark-toolbar--icon" role="menubar" tabindex="0">
<div class="spark-toolbar__container--visible">
<div class="spark-toolbar__item" label="Filter Results" aria-label="Filter Results" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content spark-toolbar__item--content__container ">
<h6>Number of Tickets</h6>
<div class="spark-slider--integrated">
<input type="number" min="1" max="30" value="4">
<div class="spark-slider__controls">
<button class="spark-slider__handle"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
<h6>Price Per Ticket</h6>
<div class="spark-range-slider">
<input type="number" min="1" max="5000" value="100" title="Start">
<span class="spark-range-slider__input-divider"></span>
<input type="number" min="1" max="5000" value="3000" title="End">
<div class="spark-slider__controls">
<button class="spark-slider__handle" title="Start"></button>
<button class="spark-slider__handle" title="End"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
</div>
<div class="spark-icon-sliders spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="View Map" aria-label="View Map" role="menuitem" tabindex="-1">
<div class="spark-icon-map spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Share Your Journey" aria-label="Share Your Journey" role="menuitem" tabindex="-1">
<div class="spark-icon-share spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Settings" aria-label="Settings" data-priority="3" data-order="1" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content">
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Save Results</li>
<li tabindex="0">Export to Excel</li>
<li tabindex="0">Create an Alert</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Modify Search</li>
<li tabindex="0">Advanced Search</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__list--checkboxes" role="menu">
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Airline</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" checked="checked" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Departure Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Arrival Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Price</span>
</label>
</li>
</ul>
</div>
<div class="spark-icon-cog spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Hotel" aria-label="Find a Hotel" role="menuitem" tabindex="-1">
<div class="spark-icon-hotel-bed spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Rental Car" aria-label="Find a Rental Car" role="menuitem" tabindex="-1">
<div class="spark-icon-car-rental spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Print Journey Summary" aria-label="Print Journey Summary" role="menuitem" tabindex="-1">
<div class="spark-icon-print spark-toolbar__item-helper"></div>
</div>
</div>
<div class="spark-toolbar__show-more" tabindex="-1">
<i class="spark-icon-menu-ellipsis-vertical"></i>
</div>
<!-- All items should be placed in .spark-toolbar__container-shown -->
<div class="spark-toolbar__container--hidden">
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
/* example styles */
.spark-toolbar-example {
background: #fff;
}
.spark-toolbar-example h3 {
line-height: 60px;
margin: 0;
}
.spark-toolbar-example .spark-toolbar {
position: absolute;
left: 0;
right: 0.5rem;
top: calc(50% - 2rem);
}
</style>
// Vanilla JS
// Vanilla JS
var el = document.querySelector('.spark-toolbar');
var toolbarInstance = new Spark.Toolbar(el);
Text Button Toolbar
Text Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
<div class="container">
<div class="spark-toolbar-example row">
<div class="col-xs-10 col-md-5">
<h3>Heading</h3>
</div>
<div class="col-xs-2 col-md-7">
<div class="spark-toolbar" role="menubar" tabindex="0">
<div class="spark-toolbar__container--visible">
<div class="spark-toolbar__item" label="Filter Results" aria-label="Filter Results" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content spark-toolbar__item--content__container ">
<h6>Number of Tickets</h6>
<div class="spark-slider--integrated">
<input type="number" min="1" max="30" value="4">
<div class="spark-slider__controls">
<button class="spark-slider__handle"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
<h6>Price Per Ticket</h6>
<div class="spark-range-slider">
<input type="number" min="1" max="5000" value="100" title="Start">
<span class="spark-range-slider__input-divider"></span>
<input type="number" min="1" max="5000" value="3000" title="End">
<div class="spark-slider__controls">
<button class="spark-slider__handle" title="Start"></button>
<button class="spark-slider__handle" title="End"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
</div>
<div class="spark-icon-sliders spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="View Map" aria-label="View Map" role="menuitem" tabindex="-1">
<div class="spark-icon-map spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Share Your Journey" aria-label="Share Your Journey" role="menuitem" tabindex="-1">
<div class="spark-icon-share spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Settings" aria-label="Settings" data-priority="3" data-order="1" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content">
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Save Results</li>
<li tabindex="0">Export to Excel</li>
<li tabindex="0">Create an Alert</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Modify Search</li>
<li tabindex="0">Advanced Search</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__list--checkboxes" role="menu">
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Airline</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" checked="checked" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Departure Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Arrival Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Price</span>
</label>
</li>
</ul>
</div>
<div class="spark-icon-cog spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Hotel" aria-label="Find a Hotel" role="menuitem" tabindex="-1">
<div class="spark-icon-hotel-bed spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Rental Car" aria-label="Find a Rental Car" role="menuitem" tabindex="-1">
<div class="spark-icon-car-rental spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Print Journey Summary" aria-label="Print Journey Summary" role="menuitem" tabindex="-1">
<div class="spark-icon-print spark-toolbar__item-helper"></div>
</div>
</div>
<div class="spark-toolbar__show-more" tabindex="-1">
<i class="spark-icon-menu-ellipsis-vertical"></i>
</div>
<!-- All items should be placed in .spark-toolbar__container-shown -->
<div class="spark-toolbar__container--hidden">
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
/* example styles */
.spark-toolbar-example {
background: #fff;
}
.spark-toolbar-example h3 {
line-height: 60px;
margin: 0;
}
.spark-toolbar-example .spark-toolbar {
position: absolute;
left: 0;
right: 0.5rem;
top: calc(50% - 2rem);
}
</style>
// Vanilla JS
var el = document.querySelector('.spark-toolbar');
var toolbarInstance = new Spark.Toolbar(el);
Limited Horizontal Space Text Example
Heading
Number of Tickets
Price Per Ticket
- Save Results
- Export to Excel
- Create an Alert
- Modify Search
- Advanced Search
<div class="container">
<div class="spark-toolbar-example row">
<div class="col-xs-10 col-md-10">
<h3>Heading</h3>
</div>
<div class="col-xs-2 col-md-2">
<div class="spark-toolbar" role="menubar" tabindex="0">
<div class="spark-toolbar__container--visible">
<div class="spark-toolbar__item" label="Filter Results" aria-label="Filter Results" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content spark-toolbar__item--content__container ">
<h6>Number of Tickets</h6>
<div class="spark-slider--integrated">
<input type="number" min="1" max="30" value="4">
<div class="spark-slider__controls">
<button class="spark-slider__handle"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
<h6>Price Per Ticket</h6>
<div class="spark-range-slider">
<input type="number" min="1" max="5000" value="100" title="Start">
<span class="spark-range-slider__input-divider"></span>
<input type="number" min="1" max="5000" value="3000" title="End">
<div class="spark-slider__controls">
<button class="spark-slider__handle" title="Start"></button>
<button class="spark-slider__handle" title="End"></button>
<span class="spark-slider__track">
<span class="spark-slider__track-fill"></span>
</span>
</div>
</div>
</div>
<div class="spark-icon-sliders spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="View Map" aria-label="View Map" role="menuitem" tabindex="-1">
<div class="spark-icon-map spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Share Your Journey" aria-label="Share Your Journey" role="menuitem" tabindex="-1">
<div class="spark-icon-share spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Settings" aria-label="Settings" data-priority="3" data-order="1" role="menuitem" tabindex="-1">
<div class="spark-toolbar__item--content">
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Save Results</li>
<li tabindex="0">Export to Excel</li>
<li tabindex="0">Create an Alert</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__item--close-on-click">
<li tabindex="0">Modify Search</li>
<li tabindex="0">Advanced Search</li>
</ul>
<ul class="spark-toolbar__list spark-toolbar__list--checkboxes" role="menu">
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Airline</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" checked="checked" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Departure Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Arrival Time</span>
</label>
</li>
<li role="menuitem">
<label>
<input type="checkbox" />
<span class="spark-toolbar__list--checkboxes--helper"></span>
<span class="spark-toolbar__list--checkboxes--content">Price</span>
</label>
</li>
</ul>
</div>
<div class="spark-icon-cog spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Hotel" aria-label="Find a Hotel" role="menuitem" tabindex="-1">
<div class="spark-icon-hotel-bed spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Find a Rental Car" aria-label="Find a Rental Car" role="menuitem" tabindex="-1">
<div class="spark-icon-car-rental spark-toolbar__item-helper"></div>
</div>
<div class="spark-toolbar__item" label="Print Journey Summary" aria-label="Print Journey Summary" role="menuitem" tabindex="-1">
<div class="spark-icon-print spark-toolbar__item-helper"></div>
</div>
</div>
<div class="spark-toolbar__show-more" tabindex="-1">
<i class="spark-icon-menu-ellipsis-vertical"></i>
</div>
<!-- All items should be placed in .spark-toolbar__container-shown -->
<div class="spark-toolbar__container--hidden">
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
/* example styles */
.spark-toolbar-example {
background: #fff;
}
.spark-toolbar-example h3 {
line-height: 60px;
margin: 0;
}
.spark-toolbar-example .spark-toolbar {
position: absolute;
left: 0;
right: 0.5rem;
top: calc(50% - 2rem);
}
</style>
// Vanilla JS
var el = document.querySelector('.spark-toolbar');
var toolbarInstance = new Spark.Toolbar(el);