├── samples
├── ExampleBlazorApp
│ ├── .gitignore
│ ├── Components
│ │ ├── Pages
│ │ │ ├── SmartTextAreaExamples
│ │ │ │ ├── Basic.razor.css
│ │ │ │ ├── Examples.razor
│ │ │ │ ├── Basic.razor
│ │ │ │ └── Configurable.razor
│ │ │ ├── LocalEmbeddingsExamples
│ │ │ │ ├── Examples.razor
│ │ │ │ └── BasicLocalEmbeddings.razor
│ │ │ ├── SmartPasteExamples
│ │ │ │ ├── Examples.razor
│ │ │ │ ├── BasicForm.razor
│ │ │ │ ├── BugReport.razor
│ │ │ │ └── MailAddress.razor
│ │ │ ├── SmartComboBoxExamples
│ │ │ │ └── Examples.razor
│ │ │ ├── Home
│ │ │ │ ├── WarnIfMissingConfiguration.razor
│ │ │ │ └── Home.razor
│ │ │ └── Error.razor
│ │ ├── Routes.razor
│ │ ├── Layout
│ │ │ ├── MainLayout.razor
│ │ │ ├── MainLayout.razor.css
│ │ │ └── NavBar.razor
│ │ ├── _Imports.razor
│ │ ├── App.razor
│ │ └── TabSet
│ │ │ ├── TabSet.razor
│ │ │ └── Tab.razor
│ ├── tailwind.config.js
│ ├── appsettings.Development.json
│ ├── wwwroot
│ │ ├── fonts
│ │ │ └── inter
│ │ │ │ ├── inter-v13-latin-200.woff2
│ │ │ │ ├── inter-v13-latin-500.woff2
│ │ │ │ ├── inter-v13-latin-600.woff2
│ │ │ │ ├── inter-v13-latin-800.woff2
│ │ │ │ └── inter-v13-latin-regular.woff2
│ │ ├── app.css
│ │ └── default-form.css
│ ├── appsettings.json
│ ├── ExampleBlazorApp.csproj
│ ├── Properties
│ │ └── launchSettings.json
│ ├── StatefulPageBase.razor
│ └── Program.cs
├── ExampleMvcRazorPagesApp
│ ├── Pages
│ │ ├── _ViewStart.cshtml
│ │ ├── _ViewImports.cshtml
│ │ ├── SmartTextArea
│ │ │ ├── Index.cshtml
│ │ │ └── Index.cshtml.cs
│ │ ├── SmartPaste
│ │ │ ├── Index.cshtml.cs
│ │ │ └── Index.cshtml
│ │ └── SmartComboBox
│ │ │ ├── Index.cshtml.cs
│ │ │ └── Index.cshtml
│ ├── Views
│ │ ├── _ViewStart.cshtml
│ │ ├── _ViewImports.cshtml
│ │ ├── Shared
│ │ │ ├── _ValidationScriptsPartial.cshtml
│ │ │ ├── Error.cshtml
│ │ │ ├── _Layout.cshtml.css
│ │ │ └── _Layout.cshtml
│ │ └── Home
│ │ │ └── Index.cshtml
│ ├── wwwroot
│ │ ├── favicon.ico
│ │ ├── js
│ │ │ └── site.js
│ │ ├── css
│ │ │ └── site.css
│ │ └── lib
│ │ │ ├── jquery
│ │ │ └── LICENSE.txt
│ │ │ ├── jquery-validation
│ │ │ └── LICENSE.md
│ │ │ ├── bootstrap
│ │ │ ├── LICENSE
│ │ │ └── dist
│ │ │ │ └── css
│ │ │ │ ├── bootstrap-reboot.min.css
│ │ │ │ ├── bootstrap-reboot.rtl.min.css
│ │ │ │ ├── bootstrap-reboot.rtl.css
│ │ │ │ └── bootstrap-reboot.css
│ │ │ └── jquery-validation-unobtrusive
│ │ │ ├── LICENSE.txt
│ │ │ ├── jquery.validate.unobtrusive.min.js
│ │ │ └── jquery.validate.unobtrusive.js
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ ├── Models
│ │ └── ErrorViewModel.cs
│ ├── ExampleMvcRazorPagesApp.csproj
│ ├── Controllers
│ │ └── HomeController.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Program.cs
├── Directory.Build.props
├── Directory.Packages.props
├── SmartComponentsSamples.sln
└── shared
│ ├── TailwindIntegration.targets
│ └── RepoSharedConfigUtil.cs
├── docs
├── images
│ ├── smart-textarea-hr.gif
│ ├── smart-paste-address.gif
│ └── smart-combobox-expenses.gif
├── configure-openai-backend.md
├── getting-started-mvc-razor-pages.md
├── getting-started-blazor.md
├── smart-combobox.md
├── smart-paste.md
├── smart-textarea.md
└── local-embeddings.md
├── .gitignore
├── RepoSharedConfig.json
├── nuget.config
├── CODE_OF_CONDUCT.md
├── SECURITY.md
├── README.md
└── .editorconfig
/samples/ExampleBlazorApp/.gitignore:
--------------------------------------------------------------------------------
1 | wwwroot/*.out.css
2 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/Pages/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/Components/Pages/SmartTextAreaExamples/Basic.razor.css:
--------------------------------------------------------------------------------
1 | ::deep textarea { height: 100px; }
2 |
--------------------------------------------------------------------------------
/docs/images/smart-textarea-hr.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/docs/images/smart-textarea-hr.gif
--------------------------------------------------------------------------------
/docs/images/smart-paste-address.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/docs/images/smart-paste-address.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | *.csproj.user
4 | *.suo
5 | *.vs
6 | node_modules/
7 | artifacts/
8 | *.lib.module.js
9 | .tailwind/
10 |
--------------------------------------------------------------------------------
/docs/images/smart-combobox-expenses.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/docs/images/smart-combobox-expenses.gif
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
2 | @addTagHelper *, SmartComponents.AspNetCore
3 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/samples/ExampleMvcRazorPagesApp/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/tailwind.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | content: ["./**/*.{razor,html,cshtml}"],
3 | theme: {
4 | extend: {},
5 | },
6 | plugins: [],
7 | }
8 |
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-200.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-200.woff2
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-500.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-500.woff2
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-600.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-600.woff2
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-800.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-800.woff2
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EngstromJimmy/smartcomponents/main/samples/ExampleBlazorApp/wwwroot/fonts/inter/inter-v13-latin-regular.woff2
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/samples/ExampleBlazorApp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using ExampleMvcRazorPagesApp
2 | @using ExampleMvcRazorPagesApp.Models
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 | @addTagHelper *, SmartComponents.AspNetCore
5 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/RepoSharedConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "SmartComponents": {
3 | // TODO: Add values here to run samples in this repo
4 | // Do not commit your changes to source control
5 |
6 | //"DeploymentName": "",
7 | //"Endpoint": "",
8 | //"ApiKey": ""
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/samples/ExampleMvcRazorPagesApp/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
12 | Request ID: @Model.RequestId
13 |
18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |
20 |21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |
26 | -------------------------------------------------------------------------------- /samples/ExampleMvcRazorPagesApp/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /samples/ExampleMvcRazorPagesApp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System.Diagnostics; 5 | using ExampleMvcRazorPagesApp.Models; 6 | using Microsoft.AspNetCore.Mvc; 7 | 8 | namespace ExampleMvcRazorPagesApp.Controllers; 9 | 10 | public class HomeController : Controller 11 | { 12 | private readonly ILogger8 | Reason: @invalidConfigException.Message 9 |
10 |
11 | To run the samples that use OpenAI inference, you need to configure an API key, either in
12 | appsettings.Development.json or in RepoSharedConfig.json at the
13 | root of this repo. For instructions, see
14 | Configure the OpenAI backend.
15 |
17 | Without an API key, you can still run Smart ComboBox 18 | and Local Embeddings samples since they do not require any external language model backend. 19 |
20 |8 | Smart Components lets you 9 | add genuinely useful AI-powered features to your .NET apps quickly and easily. 10 |
11 | 12 |13 | It's an experiment from the .NET team, and is initially available for ASP.NET Core 6.0 and later. 14 |
15 | 16 |
12 | Request ID: @RequestId
13 |
18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |
20 |21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |
26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /samples/ExampleBlazorApp/Components/Pages/SmartTextAreaExamples/Basic.razor: -------------------------------------------------------------------------------- 1 |11 | Reason: @invalidConfigException.Message 12 |
13 |
14 | To run the samples that use OpenAI inference, you need to configure an API key, either in
15 | appsettings.Development.json or in RepoSharedConfig.json at the
16 | root of this repo. For instructions, see
17 | Configure the OpenAI backend.
18 |
20 | Without an API key, you can still run Smart ComboBox 21 | sample since it does not require any external language model backend. 22 |
23 |27 | Smart Components lets you 28 | add genuinely useful AI-powered features to your .NET apps quickly and easily. 29 |
30 | 31 |32 | It's an experiment from the .NET team, and is initially available for ASP.NET Core 6.0 and later. 33 |
34 | 35 |