Searchbox

How to use the SearchBox control to create a search experience in custom pages

Default

Default Searchbox with an icon button on the right. It will use 100% of the width.

Icon on the left side

Add a .searchbox--icon-start class to move the button to the left.

Auto hide icon

The icon will only be visible if the input is in focus.

Auto hide icon

Add a .searchbox--hide-btn class to Searchbox.

Auto Expand

Default Searchbox with an icon button on the right. It will use 100% of the width.

Auto Expand

Add a .searchbox--icon-start class to move the button to the left.

Combine them with a hidden icon

Add the searchbox--hide-btn class to the searchbox.

Combine them with a hidden icon

Add the searchbox--hide-btn class to the searchbox.

Custom widths
Width Desc Preview
Default
min(50%, 15.625rem)
The Minimum value of the container
width is between 50% and 15.625rem
70% Use the CSS variable in the Searchbox
style="--nf-search-collapsed-width:70%"
160px Use build-in class width, ex .w-160px
Please check out more classes on the Sizing page.
Nifty

Background Images

Add an image to replace the solid background color

Layouts

Layouts
Transitions
Header
Additional Offcanvas

Select the offcanvas placement.

Direction

Sidebars

Navigation
Sidebar

Colors

Modes
Color Schemes
Expanded Header
Fair Header
Full Header
Primary Nav
Brand
Tall Header
Miscellaneous
Scrollbars

Hides native scrollbars and creates custom styleable overlay scrollbars.

Offcanvas Header
Content Here

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente eos nihil earum aliquam quod in dolor, aspernatur obcaecati et at. Dicta, ipsum aut, fugit nam dolore porro non est totam sapiente animi recusandae obcaecati dolorum, rem ullam cumque. Illum quidem reiciendis autem neque excepturi odit est accusantium, facilis provident molestias, dicta obcaecati itaque ducimus fuga iure in distinctio voluptate nesciunt dignissimos rem error a. Expedita officiis nam dolore dolores ea. Soluta repellendus delectus culpa quo. Ea tenetur impedit error quod exercitationem ut ad provident quisquam omnis! Nostrum quasi ex delectus vero, facilis aut recusandae deleniti beatae. Qui velit commodi inventore.