Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Component: Site Alert #981

Closed
brandonlenz opened this issue Mar 1, 2021 · 1 comment · Fixed by #1099
Closed

New Component: Site Alert #981

brandonlenz opened this issue Mar 1, 2021 · 1 comment · Fixed by #1099
Assignees
Labels
type: feature New feature or request
Milestone

Comments

@brandonlenz
Copy link
Contributor

brandonlenz commented Mar 1, 2021

Site Alert

USWDS Version

2.10.0

Description

When your agency has urgent information to share with the public, it’s essential that it stands out from other content on the site. A site alert prominently displays critical, time-sensitive warnings or directions across every page so that users see it whenever they visit the site. Using the same site alert treatment across agencies helps create a consistent and predictable way for users to find urgent information across all government websites.

Requirements (proposed)

Prop Interface

Props = {
  heading?: string // Default undefined (to allow Site alert with no header)
  variant: "info" | "emergency"
  showIcon?: boolean // Default true
  slim?: boolean // Default false
  className?: string
  children: React.ReactNode  
} & JSX.IntrinsicElements['section']

Example Implementation (proposed)

return (
  <SiteAlert heading="Short alert message">
    Additional context and followup information including <Link" href="#">a link</Link>.
  </SiteAlert>
)

More Details

  • <section>root element
  • The Alert component that we already have makes up most of the content of a SiteAlert. It's worth exploring if SiteAlert can just wrap an Alert and modify as necessary depending on the variant.
@brandonlenz brandonlenz added the type: feature New feature or request label Mar 1, 2021
@brandonlenz brandonlenz added this to the USWDS 2.10.0 milestone Mar 1, 2021
@SirenaBorracha
Copy link
Contributor

SirenaBorracha commented Apr 6, 2021

I decided after talking through it with @brandonlenz and @haworku that it's as much work to modify the existing Alert component, so I'm writing SiteAlert separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants