Banner
Banners identify official websites of government organizations in the United States. They also help visitors understand whether a website is official and secure.
This component requires the following JavaScript plugins:
Usage
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxAn official website of the United States government
Official websites use .gov
A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS
A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
Component API
A banner is composed using a x-collapse directive, using the following elements:
Root
-
<section>Using a
<section>element ensures banners can be found by navigating by landmark when using assistive technologies. -
x-collapseCustom Alpine directive that marks the Banner Root.
-
aria-labelType:
string.gov websites should use the following
aria-label:“Official website of the United States government”
Trigger
-
<button>Use a button element as a banner’s trigger.
-
x-collapse:triggerCustom Alpine directive that marks the Collapse Trigger.
-
aria-controls
Type:
stringAccessibility attribute that links the Accordion Trigger control to it’s respective Accordion Content.
Automatically handled with JavaScript.
-
-
aria-expandedType:
booleanAccessibility attribute that communicates whether an element is expanded or collapsed.
Automatically handled with JavaScript.
Content
-
x-collapse:contentCustom Alpine directive that marks the Collapse Content.
-
idType:
stringLinks the Collapse Content an it’s respective Collapse Trigger.
Automatically handled with JavaScript.
-
hiddenType:
booleanWhen
true, content will be hidden. Whenfalse, content will be visible andhiddenattribute will be removed.Automatically handled with JavaScript.