Skip to content

Commit

Permalink
feat: fancy list
Browse files Browse the repository at this point in the history
chore: test
chore: examples
  • Loading branch information
Vulpesx committed May 10, 2024
1 parent 6c25c70 commit 93bb38d
Show file tree
Hide file tree
Showing 3 changed files with 406 additions and 0 deletions.
81 changes: 81 additions & 0 deletions examples/list.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
use demand::List;

fn main() {
let _ = List::new("hewo")
.description("so many things")
.items(&[
"hi",
"hewo",
"how are u",
"i like trains",
":3",
"do you like jazz",
"hehe",
])
.filterable(true)
.run();
let _ = List::new("long hewo")
.item("Lettuce")
.item("Tomatoes")
.item("Charm Sauce")
.item("Jalapenos")
.item("Cheese")
.item("Vegan Cheese")
.item("Nutella")
.item("Peanut Butter")
.item("Banana")
.item("Strawberries")
.item("Blueberries")
.item("Pineapple")
.item("Mango")
.item("Kiwi")
.item("Passion Fruit")
.item("Peaches")
.item("Raspberries")
.item("Blackberries")
.item("Mint")
.item("Chocolate Chips")
.item("Oreos")
.item("Brownie Bites")
.item("Cookie Dough")
.item("Graham Cracker Crumbs")
.item("M&Ms")
.item("Reese's Pieces")
.item("Butterfinger")
.item("Heath Bar")
.item("Kit Kat")
.item("Snickers")
.item("Twix")
.item("Caramel")
.item("Hot Fudge")
.item("Marshmallow")
.item("Whipped Cream")
.item("Chocolate Syrup")
.item("Caramel Syrup")
.item("Strawberry Syrup")
.item("Peanut Butter Syrup")
.item("Nutella Syrup")
.item("Honey")
.item("Sprinkles")
.item("Chocolate Sprinkles")
.item("Coconut Flakes")
.item("Almonds")
.item("Peanuts")
.item("Walnuts")
.item("Pecans")
.item("Cashews")
.item("Pistachios")
.item("Macadamia Nuts")
.item("Hazelnuts")
.item("Peanut Butter Cups")
.item("Gummy Bears")
.item("Sour Patch Kids")
.item("Sour Gummy Worms")
.item("Sour Skittles")
.item("Skittles")
.item("Starburst")
.item("Twizzlers")
.item("Milk Duds")
.filterable(true)
.run();
}
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pub use confirm::Confirm;
pub use input::Input;
pub use list::List;
pub use multiselect::MultiSelect;
pub use option::DemandOption;
pub use select::Select;
Expand All @@ -11,6 +12,7 @@ pub use theme::Theme;

mod confirm;
mod input;
mod list;
mod multiselect;
mod option;
mod select;
Expand Down
Loading

0 comments on commit 93bb38d

Please sign in to comment.