PSC.Blazor.Components.ImageSelect
1.0.8
See the version list below for details.
dotnet add package PSC.Blazor.Components.ImageSelect --version 1.0.8
NuGet\Install-Package PSC.Blazor.Components.ImageSelect -Version 1.0.8
<PackageReference Include="PSC.Blazor.Components.ImageSelect" Version="1.0.8" />
paket add PSC.Blazor.Components.ImageSelect --version 1.0.8
#r "nuget: PSC.Blazor.Components.ImageSelect, 1.0.8"
// Install PSC.Blazor.Components.ImageSelect as a Cake Addin #addin nuget:?package=PSC.Blazor.Components.ImageSelect&version=1.0.8 // Install PSC.Blazor.Components.ImageSelect as a Cake Tool #tool nuget:?package=PSC.Blazor.Components.ImageSelect&version=1.0.8
ImageSelect from Blazor
This is a Blazor component to display a dropdown list with images based on ms-Dropdown by Marghoob Suleman. This component is built with NET7 for Blazor WebAssembly and Blazor Server.
Installation
Fist, you have to add the component from NuGet. Then, open your index.html
or _Host
and add at the end of the page the following CSS:
<link href="_content/PSC.Blazor.Components.ImageSelect/css/dd.css" rel="stylesheet" />
<link href="_content/PSC.Blazor.Components.ImageSelect/css/flags.css" rel="stylesheet" />
and then at the end of the file those scripts:
<script src="/_content/PSC.Blazor.Components.ImageSelect/js/dd.min.js"></script>
<script src="/_content/PSC.Blazor.Components.ImageSelect/js/imageselect.js" type="module"></script>
Open your _Imports.razor
and add the following:
@using PSC.Blazor.Components.ImageSelect
@using PSC.Blazor.Components.ImageSelect.Models.Configuration
Add a new ImageSelect
Imaging you want to display a dropdown for selecting a language. This dropdown has to display the flag of the country and the name of the language.
When the user clicks on the arrow, the component displays the list of options with the flag and the name of the language.
Here the code
<ImageSelect CssClass="@CSSClass" SelectedValueChanged="OnSelectedValueChange" Width="@Width">
@if(ShowEmptyOption) {
<Option Value="" DataTitle="@EmptyOptionText" Text="@EmptyOptionText" />
}
<Option Value="en" DataImageCss="flag gb" DataTitle="English" Text="English" />
<Option Value="es" DataImageCss="flag es" DataTitle="Spanish" Text="Spanish" />
<Option Value="pt" DataImageCss="flag pt" DataTitle="Portuguese" Text="Portuguese" />
<Option Value="de" DataImageCss="flag de" DataTitle="German" Text="German" />
<Option Value="fr" DataImageCss="flag fr" DataTitle="French" Text="French" />
<Option Value="it" DataImageCss="flag it" DataTitle="Italian" Text="Italian" />
</ImageSelect>
@code {
[Parameter] public string? CSSClass { get; set; }
[Parameter] public string Width { get; set; } = "200px";
[Parameter] public bool ShowEmptyOption { get; set; } = false;
[Parameter] public string EmptyOptionText { get; set; } = "All";
public void OnSelectedValueChange(string selectedValue)
{
var t = selectedValue;
}
}
PureSourceCode.com
PureSourceCode.com is my personal blog where I publish posts about technologies and in particular source code and projects in .NET.
In the last few months, I created a lot of components for Blazor WebAssembly and Blazor Server.
My name is Enrico Rossini and you can contact me via:
Blazor Components
Component name | Forum | NuGet | Website | Description |
---|---|---|---|---|
Autocomplete for Blazor | Forum | Simple and flexible autocomplete type-ahead functionality for Blazor WebAssembly and Blazor Server | ||
Browser Detect for Blazor | Forum | Demo | Browser detect for Blazor WebAssembly and Blazor Server | |
ChartJs for Blazor | Forum | Demo | Add beautiful graphs based on ChartJs in your Blazor application | |
Clippy for Blazor | Forum | Demo | Do you miss Clippy? Here the implementation for Blazor | |
CodeSnipper for Blazor | Forum | Add code snippet in your Blazor pages for 196 programming languages with 243 styles | ||
Copy To Clipboard | Forum | Add a button to copy text in the clipboard | ||
DataTable for Blazor | Forum | Demo | DataTable component for Blazor WebAssembly and Blazor Server | |
Icons and flags for Blazor | Forum | Library with a lot of SVG icons and SVG flags to use in your Razor pages | ||
Markdown editor for Blazor | Forum | Demo | This is a Markdown Editor for use in Blazor. It contains a live preview as well as an embeded help guide for users. | |
Modal dialog for Blazor | Forum | Simple Modal Dialog for Blazor WebAssembly | ||
Modal windows for Blazor | Forum | Modal Windows for Blazor WebAssembly | ||
Quill for Blazor | Forum | Quill Component is a custom reusable control that allows us to easily consume Quill and place multiple instances of it on a single page in our Blazor application | ||
ScrollTabs | Tabs with nice scroll (no scrollbar) and responsive | |||
Segment for Blazor | Forum | This is a Segment component for Blazor Web Assembly and Blazor Server | ||
Tabs for Blazor | Forum | This is a Tabs component for Blazor Web Assembly and Blazor Server | ||
Timeline for Blazor | Forum | This is a new responsive timeline for Blazor Web Assembly and Blazor Server | ||
Toast for Blazor | Forum | Toast notification for Blazor applications | ||
Tours for Blazor | Forum | Guide your users in your Blazor applications | ||
WorldMap for Blazor | Forum | Demo | Show world maps with your data |
C# libraries for .NET6
Component name | Forum | NuGet | Description |
---|---|---|---|
PSC.Evaluator | Forum | PSC.Evaluator is a mathematical expressions evaluator library written in C#. Allows to evaluate mathematical, boolean, string and datetime expressions. | |
PSC.Extensions | Forum | A lot of functions for .NET5 in a NuGet package that you can download for free. We collected in this package functions for everyday work to help you with claim, strings, enums, date and time, expressions... |
More examples and documentation
- Write a reusable Blazor component
- Getting Started With C# And Blazor
- Setting Up A Blazor WebAssembly Application
- Working With Blazor Component Model
- Secure Blazor WebAssembly With IdentityServer4
- Blazor Using HttpClient With Authentication
- InputSelect component for enumerations in Blazor
- Use LocalStorage with Blazor WebAssembly
- Modal Dialog component for Blazor
- Create Tooltip component for Blazor
- Consume ASP.NET Core Razor components from Razor class libraries | Microsoft Docs
- ChartJs component for Blazor
- Labels and OnClickChart for ChartJs
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.23)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.