This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
Replies: 1 comment
-
We propose discussing RFCs in pull requests rather than discussions. The proposal should be formatted as a markdown file in
As such, we are moving this discussion to PR #1428 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
DRAFT
<Header />
API proposalThere is a plan to standardise headers across the Guardian's web platforms.
This proposal outlines an API that tries to capture the areas of standardisation while being as flexible as possible for end users.
Example
Component breakdown
<Header />
Generic header component. The logo is hard-coded.
Example
<BrandBar />
The area at the top of the header that houses features related to the brand and customisation, rather than content discovery. Examples include the support message, top level links, the Guardian logo and the Edition Switch.
The logo is hardcoded.
Example
<BrandBar.Links />
A list of top-level links and menus that is displayed at the very top of the header.
<BrandBar.Link />
A link that is displayed in the
BrandBar.Links
section of the header, or within aBrandBar.LinkList
dropdown.Props
href
stringBrandBar.Link
is clickedonClick
functionBrandBar.Link
is clickedlabel
stringBrandBar.Link
icon
ReactNodefrom
BreakpointBrandBar.Link
becomes visibleuntil
BreakpointBrandBar.Link
is no longer displayed<BrandBar.LinkList />
A dropdown menu that is displayed in the
BrandBar.Links
section of the header.Props
label
stringBrandBar.LinkList
icon
ReactNodefrom
BreakpointBrandBar.LinkList
becomes visibleuntil
BreakpointBrandBar.LinkList
is no longer displayed<Navigation />
The top-level navigation bar.
Example
<Navigation.PrimaryLinks />
The main visible navigational links
Example
<Navigation.PrimaryLink />
A navigational link that appears in the
Navigation.PrimaryLinks
componentExample
Props
href
stringNavigation.PrimaryLink
is clickedlabel
stringNavigation.PrimaryLink
color
stringselected
boolean<Navigation.SecondaryLinks />
An expanding menu that opens on click of the veggie burger icon, or the "more" link at wider breakpoints
Props
???
Example
<Navigation.SecondaryLinksGroup />
A column of links within the
SecondaryLinks
panelProps
???
Example
<Navigation.SecondaryLink />
A navigational link that appears in the
Navigation.SecondaryLinks
componentProps
href
stringNavigation.SecondaryLink
is clickedlabel
stringNavigation.SecondaryLink
Example
<Navigation.SecondaryLinksSupplementalLink />
A visually prominent navigational link that appears in the
Navigation.SecondaryLinks
component.Example
Props
href
stringNavigation.SecondaryLinksSupplementalLink
is clickedlabel
stringNavigation.SecondaryLinksSupplementalLink
Specialised headers
<EditorialHeader isSignedIn showSubscriberMessage edition />
A special header layout for editorial pages. The logo and supporter messages are hard-coded.
Differences to generic header
Brandbar
<SubscribeMessage />
?Example
Props
isSignedIn
booleanshowSubscriberMessage
booleanedition
string'uk'
|'au'
|'us'
|'international'
<EditorialHeader.EditionSwitch />
The Editions switch dropdown menu appears to the right of the logo in the Editorial Header. It allows the user to switch the default edition of the network front that is displayed when they visit theguardian.com.
Example
Props
onChange
function<EditorialHeader.EditionSwitchItem />
Represents a link to an Edition that appears in the Edition Switch dropdown menu.
Example
Props
href
string<EditorialHeader.EditionSwitchItem />
onChange
code has executedlabel
stringEditionSwitchItem
selected
booleanRisks and uncertainty
<EditorialHeader brandBar={<Island><BrandBar /></Island>} />
Beta Was this translation helpful? Give feedback.
All reactions