Sidebar

Specific type of navigation bar using a Sheet.

Example

import { Sidebar } from "@styple/design-system";
// Resize your screen to see responsive-ness.
<Flex css={{ width: "100%", gap: "$md", flexDirection: "column", }} >
<Container css={{ bg: "$bg300" }}>
<Sidebar css={{ display: "flex", alignItems: "center", justifyContent: "space-between", px: "$md", height: "$xl", }} brand={<Text>Sidebar</Text>} mobileTitle="Sidebar example" content={/* Regular content as JSX */} mobileContent={/* Mobile content as JSX */} />
</Container>
</Flex>

API Reference

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

Prop Type Default Explanation
brand?ReactNode-

Display your brand in the sidebar.

contentReactNode-

The regular content of the sidebar.

mobileTitlestring-

Title displayed on mobile with mobileContent.

mobileContentReactNode-

The content to display instead on mobile.

sidestring"right"

Side to show Sheet on.

bpstring"@bp2"

Breakpoint to display regular content at.

iconReactNode"Menu"

Icon of the SheetTrigger.

open?boolean-

Controlled open. Must use onOpenChange with it.

onOpenChange?(boolean) => void-

Function called when open changes.