Skip to content

Commit

Permalink
docs: add split docs and demo (#3163)
Browse files Browse the repository at this point in the history
* docs: add split docs and demo

* fix
  • Loading branch information
sarahgm authored Jul 21, 2023
1 parent 6edfe13 commit e1b64e1
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
4 changes: 1 addition & 3 deletions docs/app/components/[...slug]/_components/PropsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export const PropsTable = ({ props }: PropsTableProps) => {
{!props ? (
<Inline space={2}>
<BlankCanvas />
<Text>
Sorry! There are currently no variants and sizes available.
</Text>
<Text>Sorry! There are currently no props available.</Text>
</Inline>
) : (
<Table aria-label="Table with component props" variant="propsTable">
Expand Down
10 changes: 10 additions & 0 deletions docs/content/components/split/split-inline.demo.tsx
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>
);
12 changes: 12 additions & 0 deletions docs/content/components/split/split-stack.demo.tsx
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>
);
38 changes: 38 additions & 0 deletions docs/content/components/split/split.mdx
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" />

2 comments on commit e1b64e1

@vercel
Copy link

@vercel vercel bot commented on e1b64e1 Jul 21, 2023

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

@vercel
Copy link

@vercel vercel bot commented on e1b64e1 Jul 21, 2023

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

Please sign in to comment.