-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(showcase): showcase paragraph widget (#387)
- Loading branch information
Showing
7 changed files
with
31 additions
and
1 deletion.
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,9 @@ | ||
# A VHS tape. See https://github.com/charmbracelet/vhs | ||
Output "../../src/content/docs/showcase/widgets/paragraph.gif" | ||
Set Theme "Aardvark Blue" | ||
Set Width 800 | ||
Set Height 220 | ||
Type "cargo run -- -w paragraph" Enter | ||
Sleep 5s | ||
Screenshot "../../src/content/docs/showcase/widgets/paragraph.png" | ||
Sleep 1s |
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ pub mod chart; | |
pub mod gauge; | ||
pub mod line_gauge; | ||
pub mod list; | ||
pub mod paragraph; | ||
pub mod table; |
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,16 @@ | ||
use ratatui::{prelude::*, widgets::*}; | ||
|
||
pub fn render(frame: &mut Frame) { | ||
let text = vec![ | ||
Line::from("Hello, Ratatui".white().on_blue().italic()), | ||
Line::from("This is a colorful line".red().underlined()), | ||
Line::from("Be bold with your paragraphs".bold()), | ||
]; | ||
|
||
let paragraph = Paragraph::new(text) | ||
.bold() | ||
.white() | ||
.alignment(Alignment::Center); | ||
|
||
frame.render_widget(paragraph, frame.size()); | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.