-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #835 **Additional Info:** - Link to markdown once implementation is finished --------- Co-authored-by: margaretkennedy <[email protected]>
- Loading branch information
1 parent
356d33a
commit 68b6515
Showing
3 changed files
with
85 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,77 @@ | ||
# Text | ||
|
||
Text represents text with no specific semantic meaning, serving as a basic element. It is equivalent to an HTML span element. | ||
|
||
## Example | ||
|
||
```python | ||
from deephaven import ui | ||
|
||
my_text_basic = ui.text("Hello world") | ||
``` | ||
|
||
## UI Recommendations | ||
|
||
Consider using [`ui.heading`](./heading.md) if you want to create different types of headings. | ||
|
||
|
||
## Content | ||
|
||
The text component is sometimes used within a parent container, like [`button`](./button.md) or [`picker`](./picker.md) to define text content when multiple children are passed (such as icons and descriptions). It inherits styling from its parent container. | ||
|
||
```python | ||
from deephaven import ui | ||
|
||
|
||
@ui.component | ||
def ui_text_content_examples(): | ||
return [ | ||
ui.button(ui.text("Press me"), variant="accent", style="fill"), | ||
ui.picker( | ||
ui.item( | ||
ui.icon("github_alt"), | ||
ui.text("Github"), | ||
ui.text("Github Option", slot="description"), | ||
text_value="Github", | ||
), | ||
ui.item( | ||
ui.icon("azure_devops"), | ||
ui.text("Azure"), | ||
ui.text("Azure Option", slot="description"), | ||
text_value="Azure", | ||
), | ||
), | ||
] | ||
|
||
|
||
my_text_content_examples = ui_text_content_examples() | ||
``` | ||
|
||
|
||
## Color | ||
|
||
The color prop sets the text color for the text component. | ||
|
||
```python | ||
from deephaven import ui | ||
|
||
|
||
my_text_color_example = ui.flex( | ||
ui.text("Faded text", color="gray-500"), | ||
ui.text("Negative text", color="negative"), | ||
ui.text("Positive text", color="positive"), | ||
ui.text("Hex color", color="#FA8072"), | ||
ui.text("Nested ", ui.text("text", color="green"), "!"), | ||
direction="column", | ||
) | ||
``` | ||
|
||
## API Reference | ||
|
||
```{eval-rst} | ||
.. dhautofunction:: deephaven.ui.text | ||
``` | ||
|
||
|
||
|
||
|
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