Promptly 1.0.4
dotnet add package Promptly --version 1.0.4
NuGet\Install-Package Promptly -Version 1.0.4
<PackageReference Include="Promptly" Version="1.0.4" />
<PackageVersion Include="Promptly" Version="1.0.4" />
<PackageReference Include="Promptly" />
paket add Promptly --version 1.0.4
#r "nuget: Promptly, 1.0.4"
#:package Promptly@1.0.4
#addin nuget:?package=Promptly&version=1.0.4
#tool nuget:?package=Promptly&version=1.0.4
Promptly
A modern, feature-rich C# library for building beautiful and interactive console applications with ease.
Overview
Promptly is a comprehensive toolkit designed to simplify console application development in C#. It provides a clean, organized set of utilities for creating professional-looking menus, handling user input, displaying progress indicators, and managing console output with style.
Features
- Interactive Menus: Create styled menus with customizable appearance, disabled options, and flexible navigation
- Input Validation: Robust input handling with type-safe readers and validation utilities
- Progress Indicators: Multiple animation styles including dots, spinners, and progress bars
- Message System: Colored output messages with support for success, warning, and error states
- Utility Functions: Common console operations like screen clearing, confirmations, and pause prompts
Installation
.NET CLI
dotnet add package Promptly
NuGet Package Manager
Install-Package Promptly
PackageReference (Manual)
Add this to your .csproj file:
<ItemGroup>
<PackageReference Include="Promptly" Version="1.0.4" />
</ItemGroup>
Package URL: https://www.nuget.org/packages/Promptly/
Quick Start
using Promptly.UI;
using Promptly.Output;
using Promptly.Input;
using Promptly.Utilities;
namespace MyConsoleApp
{
class Program
{
static void Main(string[] args)
{
Common.ClearScreen("Welcome to My App");
int choice = Menu.Show("Main Menu", new[]
{
"Start Process",
"View Settings",
"Help"
});
switch (choice)
{
case 1:
MessageWriter.WriteSuccess("Process started!");
ProgressIndicator.ShowLoader("Processing");
break;
case 2:
MessageWriter.WriteMessage("Opening settings...");
break;
case 3:
MessageWriter.WriteMessage("Help documentation...");
break;
case 0:
MessageWriter.WriteMessage("Goodbye!");
return;
}
Common.Continue();
}
}
}
Documentation
Menu System
Basic Menu
int choice = Menu.Show("Choose an option", new[] { "Option 1", "Option 2", "Exit" });
Styled Menu with Configuration
MenuConfig config = new()
{
Style = MenuStyle.Boxed,
TitleColor = ConsoleColor.Cyan,
AllowEscape = true
};
int choice = Menu.Show("Settings Menu", options, config);
Advanced Menu with Descriptions
MenuOption[] options =
[
new("Process Data", "Processes the uploaded data files"),
new("Generate Report", "Creates a summary report"),
new("Advanced Settings", "Configure advanced options") { IsEnabled = false }
];
int choice = Menu.Show("Advanced Menu", options);
Input Handling
Basic Input
string name = InputReader.ReadInput("Enter your name: ");
string age = InputReader.ReadInt("Enter your age: ", 1, 120);
string email = InputReader.ReadRequiredInput("Enter email: ");
Input Validation
if (InputValidator.IsValidEmail(email))
{
MessageWriter.WriteSuccess("Valid email address!");
}
Progress Indicators
Simple Loader
ProgressIndicator.ShowLoader("Loading data");
Spinner Animation
ProgressIndicator.ShowSpinner("Connecting to server", 3000);
Progress Bar
for (int i = 0; i <= 100; i++)
{
ProgressIndicator.ShowProgressBar(i, 100);
Thread.Sleep(50);
}
Message Output
Colored Messages
MessageWriter.WriteSuccess("Operation completed successfully!");
MessageWriter.WriteWarning("This action cannot be undone.");
MessageWriter.WriteError("Connection failed. Please try again.");
Utility Functions
Screen Management
Common.ClearScreen("Application Header");
Common.Continue(); // Press any key to continue
User Confirmation
if (Common.Confirm("Are you sure you want to delete this file?"))
{
// Perform deletion
}
Configuration Options
Menu Styles
MenuStyle.None- No stylingMenuStyle.Simple- Simple separator linesMenuStyle.Boxed- Unicode box charactersMenuStyle.Minimal- Minimal styling with underlines
Progress Styles
ProgressStyle.Dots- Animated dotsProgressStyle.Spinner- Rotating spinnerProgressStyle.Bar- Progress bar with percentageProgressStyle.Percentage- Percentage only
Message Types
MessageType.Info- Standard informationMessageType.Success- Success notificationsMessageType.Warning- Warning messagesMessageType.Error- Error notifications
Requirements
- .NET 9.0 or later
- C# 10.0 or later
Project Structure
Promptly/
├── Models/
│ └── MenuOption.cs
├── UI/
│ ├── Menu.cs
│ └── MenuStyles.cs
├── Input/
│ ├── InputReader.cs
│ └── InputValidator.cs
├── Output/
│ ├── MessageWriter.cs
│ └── ProgressIndicator.cs
└── Utilities/
└── Common.cs
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Bradley Deans GitHub: @deans-bradley
Contributing
This project is currently closed to contributions. However, feel free to fork the repository for your own use and modifications.
Changelog
Version 1.0.4
- Fix icon packaging path issue for NuGet package
- Add Promptly icon to package
Version 1.0.3
- Add Promptly icon to
.csproj - Initial release with core functionality
- Menu system with multiple styling options
- Input validation and handling
- Progress indicators and animations
- Message output with color support
- Common utility functions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.