Top navigation
Top navigation
Component demo
Interactive example
<ic-top-navigationapp-title="ICDS"status="alpha"version="v0.0.7"><svgslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg><ic-search-barslot="search"placeholder="Search"label="Search"></ic-search-bar><ic-navigation-buttonlabel="Notifications"slot="buttons"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></ic-navigation-button><ic-navigation-itemslot="navigation"label="Get started"href="#"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Accessibility"href="#"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Styles"href="#"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Components"href="#"selected="true"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Patterns"href="#"></ic-navigation-item></ic-top-navigation>
<IcTopNavigationappTitle="ICDS"status="alpha"version="v0.0.7"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcSearchBarslot="search"placeholder="Search"label="Search"/><IcNavigationButtonlabel="Notifications"slot="buttons"><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></SlottedSVG></IcNavigationButton><IcNavigationItemslot="navigation"label="Get started"href="#"/><IcNavigationItemslot="navigation"label="Accessibility"href="#"/><IcNavigationItemslot="navigation"label="Styles"href="#"/><IcNavigationItemslot="navigation"label="Components"href="#"selected/><IcNavigationItemslot="navigation"label="Patterns"href="#"/></IcTopNavigation>
Top navigation details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The app title to be displayed. This is required, unless a slotted app title link is used. |
|
|
The alignment of the top navigation content. |
|
|
Can set a custom breakpoint for the top navigation to switch to mobile mode.
Must be one of our specified breakpoints in px: |
|
|
The URL to navigate to when the app title is clicked. |
|
|
If |
|
|
The short title of the app to be displayed at small screen sizes in place of the app title. |
|
|
The status info to be displayed. |
|
|
The version info to be displayed. |
|
The app title to be displayed. This is required, unless a slotted app title link is used. |
The alignment of the top navigation content. |
Can set a custom breakpoint for the top navigation to switch to mobile mode.
Must be one of our specified breakpoints in px: |
The URL to navigate to when the app title is clicked. |
If |
The short title of the app to be displayed at small screen sizes in place of the app title. |
The status info to be displayed. |
The version info to be displayed. |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Events
All components also accept native events supported by the DOM, such as
onClick
and
onKeyDown
.
|
|
|
---|---|---|
|
|
|
|
Navigation group details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
If |
|
|
The label to display on the group. |
|
If |
The label to display on the group. |
CSS Custom Properties
|
|
---|---|
|
|
|
Methods
|
|
|
---|---|---|
|
|
|
|
Navigation item details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
If |
|
|
The destination of the navigation item. |
|
|
The human language of the linked URL. |
|
|
The label of the navigation item. |
|
|
How much of the referrer to send when following the link. |
|
|
The relationship of the linked URL as space-separated link types. |
|
|
If |
|
|
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
|
If |
The destination of the navigation item. |
The human language of the linked URL. |
The label of the navigation item. |
How much of the referrer to send when following the link. |
The relationship of the linked URL as space-separated link types. |
If |
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
|
|
|
CSS Custom Properties
|
|
---|---|
|
|
|
Methods
|
|
|
---|---|---|
|
|
|
|
Navigation button details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The label info to display. |
|
|
If |
|
|
The URL that the link points to. This will render the button as an "a" tag. |
|
|
The human language of the linked URL. |
|
|
How much of the referrer to send when following the link. |
|
|
The relationship of the linked URL as space-separated link types. |
|
|
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
|
The label info to display. |
If |
The URL that the link points to. This will render the button as an "a" tag. |
The human language of the linked URL. |
How much of the referrer to send when following the link. |
The relationship of the linked URL as space-separated link types. |
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
|
|
|
Methods
|
|
|
---|---|---|
|
|
|
|
Variants
Grouped links
Interactive example
<ic-top-navigationapp-title="ICDS"status="alpha"version="v0.0.7"><svgslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg><ic-search-barslot="search"placeholder="Search"label="Search"></ic-search-bar><ic-navigation-groupslot="navigation"label="Get started"><ic-navigation-itemlabel="Tests"href="#"></ic-navigation-item><ic-navigation-itemlabel="Theme"href="#"></ic-navigation-item><ic-navigation-itemlabel="Design"href="#"></ic-navigation-item></ic-navigation-group><ic-navigation-groupslot="navigation"label="Accessibility"expandable="true"><ic-navigation-itemlabel="Introduction"href="#"></ic-navigation-item><ic-navigation-itemlabel="Accessibility Statement"href="#"></ic-navigation-item></ic-navigation-group></ic-top-navigation>
<IcTopNavigationappTitle="ICDS"status="alpha"version="v0.0.7"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcSearchBarslot="search"placeholder="Search"label="Search"/><IcNavigationGroupslot="navigation"label="Get started"><IcNavigationItemlabel="Tests"href="#"/><IcNavigationItemlabel="Theme"href="#"/><IcNavigationItemlabel="Design"href="#"/></IcNavigationGroup><IcNavigationGroupslot="navigation"label="Accessibility"expandable><IcNavigationItemlabel="Introduction"href="#"/><IcNavigationItemlabel="Accessibility statement"href="#"/></IcNavigationGroup></IcTopNavigation>
Centre aligned
Interactive example
<ic-top-navigationapp-title="ICDS"status="alpha"version="v0.0.7"content-aligned="center"><svgslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg><ic-navigation-buttonlabel="Test button"slot="buttons"onclick="alert('test')"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg></ic-navigation-button><ic-navigation-itemslot="navigation"label="Get started"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Accessibility"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Styles"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Components"href="/"selected="true"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Patterns"href="/"></ic-navigation-item></ic-top-navigation>
<IcTopNavigationappTitle="ICDS"status="alpha"version="v0.0.7"contentAligned="center"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcNavigationButtonlabel="Test button"slot="buttons"onClick={()=>alert('test')}><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG></IcNavigationButton><IcNavigationItemslot="navigation"label="Get started"href="/"/><IcNavigationItemslot="navigation"label="Accessibility"href="/"/><IcNavigationItemslot="navigation"label="Styles"href="/"/><IcNavigationItemslot="navigation"label="Components"href="/"selected/><IcNavigationItemslot="navigation"label="Patterns"href="/"/></IcTopNavigation>
Left aligned
Interactive example
<ic-top-navigationapp-title="ICDS"status="alpha"version="v0.0.7"content-aligned="left"><svgslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg><ic-search-barslot="search"placeholder="Search"label="Search"></ic-search-bar><ic-navigation-buttonlabel="Test button"slot="buttons"onclick="alert('test')"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg></ic-navigation-button><ic-navigation-itemslot="navigation"label="Get started"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Accessibility"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Styles"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Components"href="/"selected="true"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Patterns"href="/"></ic-navigation-item></ic-top-navigation>
<IcTopNavigationappTitle="ICDS"status="alpha"version="v0.0.7"contentAligned="left"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcSearchBarslot="search"placeholder="Search"label="Search"/><IcNavigationButtonlabel="Test button"slot="buttons"onClick={()=>alert('test')}><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG></IcNavigationButton><IcNavigationItemslot="navigation"label="Get started"href="/"/><IcNavigationItemslot="navigation"label="Accessibility"href="/"/><IcNavigationItemslot="navigation"label="Styles"href="/"/><IcNavigationItemslot="navigation"label="Components"href="/"selected/><IcNavigationItemslot="navigation"label="Patterns"href="/"/></IcTopNavigation>
With badge on navigation button
Interactive example
<ic-top-navigationapp-title="ICDS"status="alpha"version="v0.0.7"><svgslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg><ic-search-barslot="search"placeholder="Search"label="Search"></ic-search-bar><ic-navigation-buttonlabel="Notifications"slot="buttons"><ic-badgelabel="4"slot="badge"variant="light"position="near"></ic-badge><svgslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></ic-navigation-button><ic-navigation-itemslot="navigation"label="Get started"href="#"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Accessibility"href="#"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Styles"href="#"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Components"href="#"selected="true"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Patterns"href="#"></ic-navigation-item></ic-top-navigation>
<IcTopNavigationappTitle="ICDS"status="alpha"version="v0.0.7"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcSearchBarslot="search"placeholder="Search"label="Search"/><IcNavigationButtonlabel="Notifications"slot="buttons"><IcBadgelabel="4"slot="badge"variant="light"position="near"/><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></SlottedSVG></IcNavigationButton><IcNavigationItemslot="navigation"label="Get started"href="#"/><IcNavigationItemslot="navigation"label="Accessibility"href="#"/><IcNavigationItemslot="navigation"label="Styles"href="#"/><IcNavigationItemslot="navigation"label="Components"href="#"selected/><IcNavigationItemslot="navigation"label="Patterns"href="#"/></IcTopNavigation>
With short app title
View on a small screen size to display the short title in place of the app title.
Interactive example
<ic-top-navigationapp-title="Intelligence Community Design System"short-app-title="ICDS"status="alpha"version="v0.0.7"><svgslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></svg><ic-navigation-itemslot="navigation"label="Get started"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Accessibility"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Styles"href="/"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Components"href="/"selected="true"></ic-navigation-item><ic-navigation-itemslot="navigation"label="Patterns"href="/"></ic-navigation-item></ic-top-navigation>
<IcTopNavigationappTitle="Intelligence Community Design System"shortAppTitle="ICDS"status="alpha"version="v0.0.7"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcNavigationItemslot="navigation"label="Get started"href="#"/><IcNavigationItemslot="navigation"label="Accessibility"href="#"/><IcNavigationItemslot="navigation"label="Styles"href="#"/><IcNavigationItemslot="navigation"label="Components"href="#"selected/><IcNavigationItemslot="navigation"label="Patterns"href="#"/></IcTopNavigation>
Conditional tabs
Interactive example
<IcTopNavigationappTitle="ApplicationName"status="alpha"version="v0.0.7"><SlottedSVGslot="app-icon"xmlns="http://www.w3.org/2000/svg"width="24"height="24"viewBox="0 0 24 24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG><IcNavigationItemlabel="One"href="/"selectedslot="navigation"/><IcNavigationItemlabel="Two"href="/"slot="navigation"/><IcNavigationItemlabel="Three"href="/"slot="navigation"/>{showNavItems &&(<><IcNavigationItemlabel="Four"href="/"slot="navigation"/><IcNavigationItemlabel="Five"href="/"slot="navigation"/></>)}</IcTopNavigation>
With React Router (using slots)
The following examples also demonstrate using a slotted link for app title, short app title and app icon.
To guarantee the correct styling for non-svg content slotted into app-icon, setwidth
,height
andfill
toinherit
.
Interactive example
<MemoryRouterinitialEntries={["/"]}><IcTopNavigationversion="v0.0.7"><NavLinkto="/"slot="app-title"> ICDS Title</NavLink><NavLinkto="/"slot="short-app-title"> ICDS</NavLink><NavLinkto="/"slot="app-icon"><SlottedSVGxmlns="http://www.w3.org/2000/svg"height="inherit"viewBox="0 0 24 24"width="inherit"fill="inherit"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG></NavLink><IcSearchBarslot="search"placeholder="Search"label="Search"/><IcNavigationButtonlabel="Test button"slot="buttons"onClick={()=>alert("test")}><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"fill="#000000"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"/></SlottedSVG></IcNavigationButton><IcNavigationItemslot="navigation"><NavLinkto="/"slot="navigation-item"> Get started</NavLink></IcNavigationItem><IcNavigationItemslot="navigation"><NavLinkto="/accessibility"slot="navigation-item"> Accessibility</NavLink></IcNavigationItem></IcTopNavigation><main><IcSectionContainerclassName={classes.sectionContainer}><Routes><Routepath="/"element={<IcTypography>This is the get started page</IcTypography>}/><Routepath="/accessibility"element={<IcTypography>This page is about accessibility</IcTypography>}/></Routes></IcSectionContainer></main></MemoryRouter>
Layout example
For full screen examples, see