Navbar

Navigation bar with items to navigate an application.

Examples

Basic navbar

Fullpage navbar

import { Navbar } from "@styple/design-system";
// Simplified code, see DemoNavbars for full source.
// Resize your screen to see responsive-ness.
<Flex css={{ width: "100%", gap: "$md", flexDirection: "column", }} >
<Container css={{ bg: "$bg300" }}>
<Navbar css={{ display: "flex", alignItems: "center", justifyContent: "space-between", p: "$md", height: "$xl", }} brand={<Text>Basic navbar</Text>} content={/* Regular content as JSX */} mobileContent={/* Mobile content as JSX */} />
</Container>
<Container css={{ bg: "$bg300" }}>
<Navbar css={{ display: "flex", alignItems: "center", justifyContent: "space-between", p: "$md", height: "$xl", }} brand={<Text>Fullpage navbar</Text>} content={/* Regular content as JSX */} mobileContent={/* Mobile content as JSX. Uses a CollapsibleTrigger for the closing anim. */} />
</Container>
</Flex>

API Reference

A custom styled component, using Collapsible internally. With props:

Prop Type Default Explanation
brand?ReactNode-

Display your brand in the navbar.

contentReactNode-

The regular content of the navbar.

mobileContentReactNode-

The content to display instead on mobile.

bpstring"@bp2"

Breakpoint to display regular content at.

open?boolean-

Controlled open. Must use onOpenChange with it.

onOpenChange?(boolean) => void-

Function called when open changes.