Banner
Add a government banner so visitors can identify an official U.S. government website and check its security information.
Examples
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxAn official website of the United States government
Component API
Place Header and collapsible Content inside Root. Trigger controls the content panel.
Root<section>
Owns the expanded state.
| Prop | Type | Description |
|---|---|---|
defaultOpen | boolean | Initially expands uncontrolled content. |
open | boolean | Controls the expanded state. |
onOpenChange | ({ open: boolean }) => void | Receives requested state changes. |
| Attribute | Value | Purpose |
|---|---|---|
data-state | open | closed | Style the open and closed states. |
Header<header>
Put Flag and HeaderText beside Trigger.
Flag<div>
Displays the U.S. flag graphic by default; children replace it.
HeaderText<div>
Place the banner message beside Flag.
Trigger<button>
Toggles the guidance panel.
| Attribute | Value | Purpose |
|---|---|---|
data-state | open | closed | Style the open and closed states. |
Indicator<div>
Shows the expansion indicator; children can replace it.
CloseButton<div>
Displays a decorative close icon in the expanded header.
Content<div>
Place Guidance parts in the collapsible panel.
| Attribute | Value | Purpose |
|---|---|---|
data-state | open | closed | Style the open and closed states. |
Guidance<div>
Use one per guidance message.
GuidanceIcon<div>
Place the icon beside GuidanceContent.
GuidanceContent<div>
Group GuidanceTitle and GuidanceBody here.
GuidanceTitle<div>
Use a short title for each guidance message.
GuidanceBody<div>
Add supporting details for the guidance title.