-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Divider | ||
--- | ||
|
||
# Divider | ||
|
||
The `Divider` component is used to separate content in a list or a layout. | ||
|
||
<Demo src="/demos/material-you/divider" /> | ||
|
||
### Usage | ||
|
||
```tsx | ||
import { BakaDivider } from "baka-ui"; | ||
|
||
function MyComponent() { | ||
return ( | ||
<BakaNavigation> | ||
<BakaNavigationItem>{/* content */}</BakaNavigationItem> | ||
<BakaNavigationItem>{/* content */}</BakaNavigationItem> | ||
<BakaDivider /> | ||
<BakaNavigationItem>{/* content */}</BakaNavigationItem> | ||
</BakaNavigation> | ||
); | ||
} | ||
``` | ||
|
||
### Examples | ||
|
||
#### Vertical Divider | ||
|
||
<Demo src="/demos/material-you/divider/vertical" style={{ height: 450 }} /> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { BakaDivider } from "baka-ui"; | ||
|
||
export default function DividerDemo() { | ||
return <BakaDivider style={{ width: 300 }} />; | ||
} |
29 changes: 29 additions & 0 deletions
29
apps/docs/src/app/demos/material-you/divider/stories/divider.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from "react"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import DividerStory, { DividerStoryProps, defaultProps } from "./page"; | ||
|
||
const meta: Meta = { | ||
title: "Material You/Divider", | ||
component: (props: DividerStoryProps) => <DividerStory {...props} />, | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
argTypes: { | ||
children: { table: { disable: true } }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
export const Basic: Story = { | ||
args: { | ||
...defaultProps, | ||
}, | ||
argTypes: { | ||
orientation: { | ||
control: "radio", | ||
options: ["horizontal", "vertical"], | ||
}, | ||
}, | ||
}; |
19 changes: 19 additions & 0 deletions
19
apps/docs/src/app/demos/material-you/divider/stories/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { BakaDivider, BakaDividerProps } from "baka-ui"; | ||
|
||
export type DividerStoryProps = BakaDividerProps & { | ||
orientation?: "horizontal" | "vertical"; | ||
}; | ||
|
||
export const defaultProps: DividerStoryProps = { | ||
orientation: "horizontal", | ||
}; | ||
|
||
export default function DividerStoryDemo(props: DividerStoryProps) { | ||
const args = { ...defaultProps, ...props }; | ||
|
||
return args.orientation === "horizontal" ? ( | ||
<BakaDivider style={{ width: 300 }} /> | ||
) : ( | ||
<BakaDivider style={{ width: 1, height: 300 }} /> | ||
); | ||
} |
5 changes: 5 additions & 0 deletions
5
apps/docs/src/app/demos/material-you/divider/vertical/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { BakaDivider } from "baka-ui"; | ||
|
||
export default function DividerDemo() { | ||
return <BakaDivider style={{ width: 1, height: 300 }} />; | ||
} |