# Gradio.Net
**Repository Path**: wanglisoftware/Gradio.Net
## Basic Information
- **Project Name**: Gradio.Net
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-05-31
- **Last Updated**: 2024-05-31
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[δΈζ](readme_files/README_zh-cn.md)
# Gradio.NET: Build Machine Learning Web Apps β in .NET
Gradio for .NET β a port of [Gradio](https://github.com/gradio-app/gradio), an open-source Python package that allows you to quickly **build** a demo or web application for your machine learning model, API, or any arbitrary Python function. *No JavaScript, CSS, or web hosting experience needed!*

It just takes a few lines of .NET code to create a beautiful demo like the one above, so let's get started π«
### Building Your First Demo
- 1. Create a ASP.NET Core Web API project.
- 2. Install NuGet pacakge **Gradio.Net**.
- 3. Enter the sample code in Program.cs:
```C#
App.Launch(await CreateBlocks());
async Task CreateBlocks()
{
using (var blocks = gr.Blocks())
{
gr.Markdown("Start typing below and then click **Run** to see the output.");
Textbox input, output;
using (gr.Row())
{
input = gr.Textbox(placeholder: "What is your name?");
output = gr.Textbox();
}
var btn = gr.Button("Run");
await btn.Click(fn: async (input) => gr.Output($"Welcome to Gradio.Net, {Textbox.Payload(input.Data[0])}!"), inputs: new[] { input }, outputs: new[] { output });
return blocks;
}
}
```
That's Allπππ
**If you wan to use **Gradio.Net** in exists project**
You can use `AddGradio` and `UseGradio` extension methods:
```C#
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGradio();
var app = builder.Build();
app.UseGradio(await CreateBlocks());
app.Run();
```
### Progressing
At present, Gradio.Net is only a M.V.P version, and more Gradio components will be ported later.
- **Blocks**
- **[Row](./readme_files/layout_demo.md)**
- **Markdown**
- **Textbox**(event not implemented)
- **Button**
- **[Image](./readme_files/image_demo.md)**
- **[Column](./readme_files/layout_demo.md)**
- **[Tab](./readme_files/layout_demo.md)**
- **[Group](./readme_files/layout_demo.md)**
- **[Accordion](./readme_files/layout_demo.md)**
- **[Chatbot](./readme_files/chatbot_demo.md)**