Show main sections
Mainnav gives users access to the top-level areas of a service.
This component is the primary means that your users will use to navigate through your portal.
Mainnav gives users access to the top-level areas of a service.
Use the brand slot so users know which service they are using.
The navigation adapts from desktop layouts to smaller screens.
Toggle the fluid prop to remove the max-width constraint and stretch the navbar across the viewport.
Default behaviour. Content is bounded by the standard SGDS container max-width.
Mark the current page with active and use disabled to indicate items that are unavailable.
Highlights the current page so users know where they are in the site.
Use sgds-mainnav-dropdown to group related destinations under a single navigation item.
Flat list of items, best when there are five or fewer destinations.
Use the end slot to anchor sign-in buttons or other actions to the right end of the navbar.
Use when the navbar carries only navigation links.
The non-collapsible slot keeps critical actions visible even when navigation items collapse.
Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.
sgds-mainnav-padding-x—sgds-mainnav-mobile-padding-x—sgds-padding-md16pxsgds-padding-sm—sgds-gap-xl—sgds-gap-xs8pxsgds-border-width-11pxsgds-border-width-4Width variessgds-spacer-4—sgds-icon-size-sm—sgds-mainnav-max-widthWidth variessgds-outline-focus—sgds-outline-offset-focus—sgds-z-index-floating—Reserve mainnav for primary sections every user needs. Keep secondary or task-specific links elsewhere.
Long mainnavs are hard to scan. With more than five items, consolidate or move some into a dropdown or subnav.
Anchor user-account actions like sign in to the end slot so users find them in a consistent place.
The end slot draws strong attention. Reserve it for one global action, not promotional links or badges.
TabShift+TabEnterSpaceShare them with us on Slack → #ask-sgds-v3
Report it on GitHub Issues → sgds/components/mainnav
The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.