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>
A custom styled component, using Collapsible
internally. With props:
Prop | Type | Default | Explanation |
---|---|---|---|
brand? | ReactNode | - | Display your brand in the navbar. |
content | ReactNode | - | The regular content of the navbar. |
mobileContent | ReactNode | - | The content to display instead on mobile. |
bp | string | "@bp2" |
Breakpoint to display regular content at. |
open? | boolean | - | Controlled open. Must use |
onOpenChange? | (boolean) => void | - | Function called when open changes. |