Blazor.FloatingUI
1.1.2
dotnet add package Blazor.FloatingUI --version 1.1.2
NuGet\Install-Package Blazor.FloatingUI -Version 1.1.2
<PackageReference Include="Blazor.FloatingUI" Version="1.1.2" />
paket add Blazor.FloatingUI --version 1.1.2
#r "nuget: Blazor.FloatingUI, 1.1.2"
// Install Blazor.FloatingUI as a Cake Addin #addin nuget:?package=Blazor.FloatingUI&version=1.1.2 // Install Blazor.FloatingUI as a Cake Tool #tool nuget:?package=Blazor.FloatingUI&version=1.1.2
Floating UI
All documentation on this site and parameters were taken from this documentation.
Installation
dotnet add package Blazor.FloatingUI
Program.cs
builder.Services.AddScoped<FloatingJsProvider>();
MainLayout.razor
Add <SectionOutlet SectionId="FloatingConstants.FloatingSection"/>
Description
This is a barebones library that provides access to the FloatingUI
library and facilitates the transfer of float elements to the end of the document.
You can use this library to create dropdowns, combo boxes, hints, etc.
This library is more intended for use with other libraries or custom components.
Basic Principles
To bind a floating window to your trigger, you must pass @context
in the id field; otherwise, nothing will work.
Examples
Basic FloatingWrapper
example where there are no enhancements such as focus checking, etc.
<FloatingWrapper IsOpen="_isOpen">
<TriggerTemplate>
<button @onclick="() => _isOpen = true"
id="@context">
CLICK ME
</button>
</TriggerTemplate>
<ContentTemplate>
<div id="@context"
class="floating__content__wrapper"
tabindex="0"
@onblur="() => _isOpen = false">
<ul>
@foreach (var item in Enumerable.Range(0, 10))
{
<li @onclick="ClickHandler">
Item @item
</li>
}
</ul>
</div>
</ContentTemplate>
</FloatingWrapper>
@code {
private bool _isOpen;
private void ClickHandler()
{
_isOpen = false;
}
}
If you need additional information, feel free to ask.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. 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. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.4)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Blazor.FloatingUI:
Package | Downloads |
---|---|
Blazor.HeadlessUI.Dropdown
A lightweight and customizable headless UI Dropdown component for Blazor projects. |
GitHub repositories
This package is not used by any popular GitHub repositories.