forked from deephaven/deephaven-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
78 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Heading | ||
|
||
The Heading component is used to create different levels of headings. | ||
|
||
By default, it creates a level 3 (`<h3>`) heading. | ||
|
||
## Example | ||
|
||
```python | ||
from deephaven import ui | ||
|
||
my_heading_basic = ui.heading("Hello world") | ||
``` | ||
|
||
## UI recommendations | ||
|
||
Consider using a [`text`](./text.md) component if the content does not require a specific heading level or semantic importance, such as for paragraphs or inline text. | ||
|
||
|
||
## Content | ||
|
||
The heading component represents a header that inherits styling from its parent container. | ||
|
||
```python | ||
from deephaven import ui | ||
|
||
|
||
@ui.component | ||
def ui_heading_content_examples(): | ||
return [ | ||
ui.heading("Heading 1", level=1), | ||
ui.heading("Heading 2", level=2), | ||
ui.heading("Heading 3", level=3), | ||
ui.heading("Heading 4", level=4), | ||
ui.heading("Heading 5", level=5), | ||
ui.heading("Heading 6", level=6), | ||
ui.time_field( | ||
label="Sample Label", | ||
contextual_help=ui.contextual_help(ui.heading("Content tips")), | ||
), | ||
] | ||
|
||
|
||
my_heading_content_examples = ui_heading_content_examples() | ||
``` | ||
|
||
|
||
## Color | ||
|
||
The color prop sets the text color for the heading component. | ||
|
||
```python | ||
from deephaven import ui | ||
|
||
|
||
my_heading_color_example = ui.flex( | ||
ui.heading("Faded heading", color="gray-500"), | ||
ui.heading("Negative heading", color="negative"), | ||
ui.heading("Positive heading", color="positive"), | ||
ui.heading("Hex color", color="#FA8072"), | ||
ui.heading("Nested ", ui.text("example", color="green"), "!"), | ||
direction="column", | ||
) | ||
``` | ||
|
||
## API Reference | ||
|
||
```{eval-rst} | ||
.. dhautofunction:: deephaven.ui.heading | ||
``` |
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