Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Expand sidebars by default for certain categories, add link to flexbox froggy #1073

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/plotly-express/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
{
"label": "Plot Types",
"collapsible": false,
"items": [
{
"label": "Area",
Expand Down Expand Up @@ -117,6 +118,7 @@
},
{
"label": "Concepts",
"collapsible": false,
"items": [
{
"label": "Plot by",
Expand Down
14 changes: 8 additions & 6 deletions plugins/ui/docs/components/flex.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Flex

A [flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox)-based layout container that utilizes dimension values and supports the gap property for consistent spacing between items.

> [!TIP]
> The `flex` component follows the same rules as a browser CSS flexbox. The [CSS flexbox layout guide](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) from CSS-Tricks and the [Flexbox Froggy](https://flexboxfroggy.com/) game are great resources to learn more about flexbox.

## Example

```python
Expand All @@ -24,6 +28,7 @@ my_flex = ui_flex()
The `direction` prop determines the direction in which the flex items are laid out.

Options:

- `row` (default): the flex items are arranged horizontally from left to right.
- `column`: the flex items are arranged vertically from top to bottom.
- `row-reverse`: the flex items are arranged horizontally from right to left.
Expand Down Expand Up @@ -98,7 +103,6 @@ def ui_flex_nesting():
my_flex_nesting = ui_flex_nesting()
```


## Wrapping

When enabled, items that overflow wrap into the next row. Resize your browser window to see the items reflow.
Expand All @@ -124,12 +128,12 @@ def ui_flex_wrap():
my_flex_wrap = ui_flex_wrap()
```


## Justification

The `justify_content` prop is used to align items along the main axis. When the direction is set to "column", it controls the vertical alignment, and when the direction is set to "row", it controls the horizontal alignment.

Options:

- `stretch` (default): the flex items are stretched to fill the container along the cross-axis.
- `start`: the flex items are aligned at the start of the cross-axis.
- `end`: the flex items are aligned at the end of the cross-axis.
Expand Down Expand Up @@ -200,12 +204,12 @@ def ui_flex_justify():
my_flex_justify = ui_flex_justify()
```


## Alignment

The `align_items` prop aligns items along the cross-axis. When the direction is set to "column", it controls horizontal alignment, and when it is set to "row", it controls vertical alignment.

Options:

- `stretch` (default): the flex items are stretched to fill the container along the cross-axis.
- `start`: the flex items are aligned at the start of the cross-axis.
- `end`: the flex items are aligned at the end of the cross-axis.
Expand Down Expand Up @@ -254,7 +258,6 @@ def ui_flex_align_vertical():
my_flex_align_vertical = ui_flex_align_vertical()
```


```python
from deephaven import ui

Expand Down Expand Up @@ -289,9 +292,8 @@ def ui_flex_align_horizontal():
my_flex_align_horizontal = ui_flex_align_horizontal()
```


## API reference

```{eval-rst}
.. dhautofunction:: deephaven.ui.flex
```
```
1 change: 1 addition & 0 deletions plugins/ui/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
{
"label": "Describing the UI",
"collapsible": false,
"items": [
{
"label": "Your First Component",
Expand Down
Loading