-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5113 from Textualize/new-demo
New demo
- Loading branch information
Showing
47 changed files
with
1,738 additions
and
173 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
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,6 @@ | ||
--- | ||
title: "textual.layout" | ||
--- | ||
|
||
|
||
::: textual.layout |
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,23 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.widgets import Link | ||
|
||
|
||
class LabelApp(App): | ||
AUTO_FOCUS = None | ||
CSS = """ | ||
Screen { | ||
align: center middle; | ||
} | ||
""" | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Link( | ||
"Go to textualize.io", | ||
url="https://textualize.io", | ||
tooltip="Click me", | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
app = LabelApp() | ||
app.run() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Link | ||
|
||
!!! tip "Added in version 0.84.0" | ||
|
||
A widget to display a piece of text that opens a URL when clicked, like a web browser link. | ||
|
||
- [x] Focusable | ||
- [ ] Container | ||
|
||
|
||
## Example | ||
|
||
A trivial app with a link. | ||
Clicking the link open's a web-browser—as you might expect! | ||
|
||
=== "Output" | ||
|
||
```{.textual path="docs/examples/widgets/link.py"} | ||
``` | ||
|
||
=== "link.py" | ||
|
||
```python | ||
--8<-- "docs/examples/widgets/link.py" | ||
``` | ||
|
||
|
||
## Reactive Attributes | ||
|
||
| Name | Type | Default | Description | | ||
| ------ | ----- | ------- | ----------------------------------------- | | ||
| `text` | `str` | `""` | The text of the link. | | ||
| `url` | `str` | `""` | The URL to open when the link is clicked. | | ||
|
||
|
||
## Messages | ||
|
||
This widget sends no messages. | ||
|
||
## Bindings | ||
|
||
The Link widget defines the following bindings: | ||
|
||
::: textual.widgets.Link.BINDINGS | ||
options: | ||
show_root_heading: false | ||
show_root_toc_entry: false | ||
|
||
|
||
## Component classes | ||
|
||
This widget contains no component classes. | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
::: textual.widgets.Link | ||
options: | ||
heading_level: 2 |
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
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
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
Oops, something went wrong.