Skip to content

Commit

Permalink
Added documentation for Divider component (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
smmr-dn authored Sep 13, 2024
1 parent 5537768 commit 90861e6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/website/src/content/docs/divider.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Divider
description: A divider can be used to separate a layout into different sections of content or element.
group: utilities
thumbnail: #TODO
---

<p>{frontmatter.description}</p>

<LiveExample src='Divider.main.jsx' truncate={false}>
<AllExamples.DividerMainExample client:load />
</LiveExample>

## Vertical

The `Divider` component is displayed horizontally by default. To display it vertically, use the `orientation` prop.

<LiveExample src='Divider.vertical.jsx' truncate={false}>
<AllExamples.DividerVerticalExample client:load />
</LiveExample>

## Props

<PropsTable path='@itwin/itwinui-react/esm/core/Divider/Divider.d.ts' />
6 changes: 6 additions & 0 deletions examples/Divider.main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.demo-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
}
16 changes: 16 additions & 0 deletions examples/Divider.main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as React from 'react';
import { Divider, Text } from '@itwin/itwinui-react';

export default () => {
return (
<div className='demo-container'>
<Text variant='subheading'>Section 1</Text>
<Divider />
<Text variant='subheading'>Section 2</Text>
</div>
);
};
6 changes: 6 additions & 0 deletions examples/Divider.vertical.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.demo-container {
display: flex;
flex-direction: row;
gap: 1rem;
align-items: center;
}
16 changes: 16 additions & 0 deletions examples/Divider.vertical.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as React from 'react';
import { Divider, Text } from '@itwin/itwinui-react';

export default () => {
return (
<div className='demo-container'>
<Text variant='subheading'>Section 1</Text>
<Divider orientation='vertical' />
<Text variant='subheading'>Section 2</Text>
</div>
);
};
10 changes: 10 additions & 0 deletions examples/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,16 @@ export { DialogPlacementExample };

// ----------------------------------------------------------------------------

import { default as DividerMainExampleRaw } from './Divider.main';
const DividerMainExample = withThemeProvider(DividerMainExampleRaw);
export { DividerMainExample };

import { default as DividerVerticalExampleRaw } from './Divider.vertical';
const DividerVerticalExample = withThemeProvider(DividerVerticalExampleRaw);
export { DividerVerticalExample };

// ----------------------------------------------------------------------------

import { default as DropdownButtonMainExampleRaw } from './DropdownButton.main';
const DropdownButtonMainExample = withThemeProvider(
DropdownButtonMainExampleRaw,
Expand Down

0 comments on commit 90861e6

Please sign in to comment.