diff --git a/packages/core/src/components/divider/divider.md b/packages/core/src/components/divider/divider.md index deb62a6a33e..85742db0949 100644 --- a/packages/core/src/components/divider/divider.md +++ b/packages/core/src/components/divider/divider.md @@ -1,11 +1,30 @@ @# Divider -__Divider__ visually separate contents with a thin line and margin on all sides. +**Divider** visually separate contents with a thin line and margin on all sides. +It works best in flex layouts where they will adapt to orientation without +additional styles. Otherwise, a **Divider** will appear as a full-width 1px-high block element. -Dividers work best in flex layouts where they will adapt to orientation without additional styles. Otherwise, a -divider will appear as a full-width 1px-high block element. +@## Import -@reactExample DividerExample +```tsx +import { Divider } from "@blueprintjs/core"; +``` + +@## Usage + +Use **Divider** to separate blocks of content within a page or container. By default, it spans the full width of its container. + +@reactCodeExample DividerBasicExample + +@## Vertical + +When used inside a flex container, **Divider** adapts to the layout's direction. It becomes a vertical divider when placed between flex items. + +@reactCodeExample DividerVerticalExample + +@## Interactive Playground + +@reactExample DividerPlaygroundExample @## Props interface diff --git a/packages/docs-app/src/examples/core-examples/dividerExample.tsx b/packages/docs-app/src/examples/core-examples/dividerExample.tsx deleted file mode 100644 index 1dbdc3e4eec..00000000000 --- a/packages/docs-app/src/examples/core-examples/dividerExample.tsx +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2015 Palantir Technologies, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as React from "react"; - -import { Button, ButtonGroup, Divider, H5, Switch } from "@blueprintjs/core"; -import { Example, type ExampleProps, handleBooleanChange } from "@blueprintjs/docs-theme"; - -export interface DividerExampleState { - vertical: boolean; -} - -export class DividerExample extends React.PureComponent { - public state: DividerExampleState = { vertical: false }; - - private handleVerticalChange = handleBooleanChange(vertical => this.setState({ vertical })); - - public render() { - const { vertical } = this.state; - const options = ( - <> -
Example props
- - - ); - return ( - - -