-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add split docs and demo (#3163)
* docs: add split docs and demo * fix
- Loading branch information
Showing
4 changed files
with
61 additions
and
3 deletions.
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
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,10 @@ | ||
import { Inline, Split, Text } from '@marigold/components'; | ||
|
||
export default () => ( | ||
<Inline space={2}> | ||
<Text>Blog</Text> | ||
<Text>About</Text> | ||
<Split /> | ||
<Text>Login</Text> | ||
</Inline> | ||
); |
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,12 @@ | ||
import { Stack, Split, Text } from '@marigold/components'; | ||
|
||
export default () => ( | ||
<div className="h-48"> | ||
<Stack space={1} stretch> | ||
<Text>It's gonna be ...</Text> | ||
<Text>wait for it!</Text> | ||
<Split /> | ||
<Text>... legendary!</Text> | ||
</Stack> | ||
</div> | ||
); |
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,38 @@ | ||
--- | ||
title: Split | ||
group: Layout | ||
caption: Component that creates spacing between two elements. | ||
--- | ||
|
||
`<Split>` is a layout component that allows to split the contents of [`<Inline>`](/components/inline/) and [`<Stack>`](/component/stack/) layouts. | ||
It should be used if you need to create spacing between elements. | ||
|
||
The component behaves like the common used `flex-grow` attribute. | ||
|
||
## Usage | ||
|
||
### Import | ||
|
||
To import the component you just have to use this code below. | ||
|
||
```tsx | ||
import { Split } from '@marigold/components'; | ||
``` | ||
|
||
### Props | ||
|
||
<PropsTable /> | ||
|
||
## Examples | ||
|
||
### With Inline | ||
|
||
You can see below how to use the `<Split>` within the `<Inline>`. | ||
|
||
<ComponentDemo file="./split-inline.demo.tsx" /> | ||
|
||
### With Stack | ||
|
||
That example shows how to use the `<Split>` within the `<Stack>`. | ||
|
||
<ComponentDemo file="./split-stack.demo.tsx" /> |
e1b64e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
marigold-storybook – ./
marigold-storybook-marigold.vercel.app
marigold-storybook-git-main-marigold.vercel.app
marigold-latest.vercel.app
e1b64e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
marigold-docs – ./
marigold-docs-marigold.vercel.app
marigold-docs-git-main-marigold.vercel.app
marigold-docs.vercel.app