Banner eject-only
Warning
This is an eject-only component, designed specifically for wrap/eject, and is not recommended for direct use in MDX files
Banner displays a notification banner at the top of the page, supporting link navigation and close functionality.
Usage
Use the Banner component by customizing the Layout:
theme/index.tsx
Props
display
- Type:
boolean - Default:
true
Controls whether the Banner is displayed.
storage
- Type:
'localStorage' | 'sessionStorage' | false - Default:
'localStorage'
How to store the closed state after the user closes the Banner. Set to false to not store.
storageKey
- Type:
string - Default:
'rp-banner-closed'
Key name for storing the closed state.
href
- Type:
string
Link to navigate when clicking the Banner.
message
- Type:
string | ReactNode
Message content displayed in the Banner.
customChildren
- Type:
ReactNode
Fully customized content for the Banner. When using this property, href and message will be ignored.