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