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: Summary box #988

Closed
brandonlenz opened this issue Mar 4, 2021 · 0 comments · Fixed by #1098
Closed

New Component: Summary box #988

brandonlenz opened this issue Mar 4, 2021 · 0 comments · Fixed by #1098
Assignees
Labels
type: feature New feature or request
Milestone

Comments

@brandonlenz
Copy link
Contributor

brandonlenz commented Mar 4, 2021

Summary box

USWDS Version

2.10.0

Description

A summary box highlights key information from a longer page or displays next steps.

Requirements (proposed)

Prop Interface

interface SummaryBoxLinkProps = {
  href: string
 // We should internally just make use of our custom Link, perhaps the way BreadcrumbLink or IdentifierLink are designed
}
interface SummaryBoxInfoItemProps = {
  children?: React.ReactNode
  className?: string
}
interface SummaryBoxProps = {
  heading: string
  children: React.ReactElement< SummaryBoxInfoItemProps > | React.ReactElement< SummaryBoxInfoItemProps >[]
  className?: string
}

Example Implementation (proposed)

return (
  <SummaryBox heading="Key Information">
    <SummaryBoxInfoItem>
      If you are under a winter storm warning, <SummaryBoxLink href="#usa-anchor-find-shelter">find shelter</SummaryBoxLink> right away.
    </SummaryBoxInfoItem>
    <SummaryBoxInfoItem>
      Sign up for <SummaryBoxLink href="#usa-anchor-warning-system">your community’s warning system</SummaryBoxLink>.
    </SummaryBoxInfoItem>
    <SummaryBoxInfoItem>
      Learn the signs of, and basic treatments for, <SummaryBoxLink" href="#usa-anchor-frostbite">frostbite</SummaryBoxLink> and <SummaryBoxLink href="#usa-anchor-hypothermia">hypothermia</SummaryBoxLink>.
    </SummaryBoxInfoItem>
    <SummaryBoxInfoItem>
      Gather emergency supplies for your <SummaryBoxLink href="#usa-anchor-home">home</SummaryBoxLink> and your <SummaryBoxLink href="#usa-anchor-car">car</SummaryBoxLink>.
    </SummaryBoxInfoItem>
  </SummaryBox>
)

More Details

  • <div>root element
  • <li> root element for SummaryBoxInfoItem
  • SummaryBoxLink should make use of our Link asCustom similar to BreadcrumbLink.
@brandonlenz brandonlenz added the type: feature New feature or request label Mar 4, 2021
@brandonlenz brandonlenz added this to the USWDS 2.10.0 milestone Mar 4, 2021
@SirenaBorracha SirenaBorracha self-assigned this Apr 5, 2021
@SirenaBorracha SirenaBorracha linked a pull request Apr 6, 2021 that will close this issue
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