
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
@slice-and-dice/govuk-react-top-nav
Advanced tools
Styled top navigation header with numerous constituent parts input as props.
import TopNav from '@govuk-react/top-nav';
TopNav with logo, service title and navigation items
import CrownIcon from '@govuk-react/icon-crown';
import SearchBox from '@govuk-react/search-box';
import TopNav, { asNavLinkAnchor, asTopNavAnchor } from '@govuk-react/top-nav';
const LogoAnchor = asTopNavAnchor('a');
const NavAnchor = asNavLinkAnchor('a');
const link = 'https://example.com?=1';
const Company = (
<LogoAnchor href={link} target="new">
<TopNav.IconTitle icon={<CrownIcon width="36" height="32" />}>GOV.UK</TopNav.IconTitle>
</LogoAnchor>
);
const ServiceTitle = (
<NavAnchor href={link} target="new">
Service Title
</NavAnchor>
);
const Search = (
<SearchBox placeholder="Search">hi</SearchBox>
);
<TopNav company={Company} serviceTitle={ServiceTitle} search={Search} active={0}>
<NavAnchor href="https://example.com?q=catdog" target="new">Navigation item #1</NavAnchor>
<NavAnchor href="https://example.com?q=dogcat" target="new">Navigation item #2</NavAnchor>
</TopNav>
import { BrowserRouter, Link } from 'react-router-dom';
import CrownIcon from '@govuk-react/icon-crown';
import TopNav, { asLogoAnchor, asNavLinkAnchor } from '@govuk-react/top-nav';
const LogoLink = asTopNavAnchor(Link);
const NavLink= asNavLinkAnchor(Link);
const reactRouterLink = '/section';
const CompanyLink = (
<LogoLink to={reactRouterLink}>
<TopNav.IconTitle icon={<CrownIcon width="36" height="32" />}>GOV.UK</TopNav.IconTitle>
</LogoLink>
);
const ServiceTitleLink = (
<NavLink to={reactRouterLink}>
Service Title
</NavLink>
);
<BrowserRouter>
<TopNav company={CompanyLink} serviceTitle={ServiceTitleLink} />
</BrowserRouter>
active
navigation itemsProp | Required | Default | Type | Description |
---|---|---|---|---|
bgColor | BLACK | string | Top nav background color | |
children | undefined | node | List Navigation items with anchor tags e.g. NavAnchor components | |
color | WHITE | string | Top nav text color | |
company | <IconTitle icon={<CrownIcon width="36" height="32" />}>GOV.UK</IconTitle> | node | Company component e.g. GOV UK | |
defaultOpen | false | bool | Is the mobile navigation open by default? | |
search | false | node | Search component | |
serviceTitle | undefined | node | Service title component e.g. Food Standards Authority |
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.