Blazor.FloatingUI 1.0.1

dotnet add package Blazor.FloatingUI --version 1.0.1
NuGet\Install-Package Blazor.FloatingUI -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazor.FloatingUI" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.FloatingUI --version 1.0.1
#r "nuget: Blazor.FloatingUI, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Blazor.FloatingUI as a Cake Addin
#addin nuget:?package=Blazor.FloatingUI&version=1.0.1

// Install Blazor.FloatingUI as a Cake Tool
#tool nuget:?package=Blazor.FloatingUI&version=1.0.1

Floating UI

All documentation on this site and parameters were taken from this documentation.

Visit FloatingUI website

Installation

dotnet add package Blazor.FloatingUI

Program.cs

builder.Services.AddScoped<FloatingJsProvider>();

MainLayout.razor

Add @layout FluentLayout

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 @_index
        </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 tabindex="@item"
                        @onclick="() => ClickHandler(item)">
                        Item @item
                    </li>
                }
            </ul>
        </div>
    </ContentTemplate>
</FloatingWrapper>

@code {

    private bool _isOpen;

}

If you need additional information, feel free to ask.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 71 5/10/2024
1.0.0 62 5/10/2024