An open API service indexing awesome lists of open source software.

https://github.com/soenneker/soenneker.blazor.floating.tooltips

A modern Blazor interop library for Floating UI-powered tooltips
https://github.com/soenneker/soenneker.blazor.floating.tooltips

blazor blazorlibrary csharp dotnet floating floating-ui floatingtooltip tooltips ui

Last synced: about 2 months ago
JSON representation

A modern Blazor interop library for Floating UI-powered tooltips

Awesome Lists containing this project

README

          

[![](https://img.shields.io/nuget/v/soenneker.blazor.floating.tooltips.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.blazor.floating.tooltips/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.floating.tooltips/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.floating.tooltips/actions/workflows/publish-package.yml)
[![](https://img.shields.io/nuget/dt/soenneker.blazor.floating.tooltips.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.blazor.floating.tooltips/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.floating.tooltips/codeql.yml?label=CodeQL&style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.floating.tooltips/actions/workflows/codeql.yml)

# ![Logo](https://user-images.githubusercontent.com/4441470/224455560-91ed3ee7-f510-4041-a8d2-3fc093025112.png) Soenneker.Blazor.Floating.Tooltips

### ? A modern Blazor interop library for **Floating UI**-powered tooltips

> ?? **[Click here to try the demo](https://soenneker.github.io/soenneker.blazor.floating.tooltips/)**

`Soenneker.Blazor.Floating.Tooltips` is a fully featured Blazor component library that integrates with [Floating UI](https://floating-ui.com/) to provide sleek, customizable, and highly interactive tooltips using a pure C# API.

---

## ? Features

- ? Position-aware and collision-resistant tooltips
- ?? Custom placements, delays, and themes
- ?? Interactive and manually triggered tooltips
- ?? Dark/light theming with optional arrows
- ?? Full control via C# with event callbacks
- ?? Lightweight with optional CDN usage
- ?? Runtime toggle, show, and hide support
- ?? Optimized for performance and resilience

---

## ?? Installation

```bash
dotnet add package Soenneker.Blazor.Floating.Tooltips
```

Register:

```csharp
services.AddFloatingTooltipAsScoped();
```

---

## ??? Usage

Basic example with plain string content:

```razor

Hover me

```

With full options and event handling:

```razor

Hover over me

@code {
private void HandleShow() => Console.WriteLine("Tooltip shown!");
private void HandleHide() => Console.WriteLine("Tooltip hidden!");
}
```

Using `TooltipContent` instead of `Text`:

```razor


?? Smart Tooltip
Rich content goes here


Hover me

```

---

## ?? Options

You can use the `Options` parameter or inline params:

```razor
Options = new FloatingTooltipOptions
{
Animate = true,
ShowArrow = true,
Theme = FloatingTooltipTheme.Light,
MaxWidth = 250,
ManualTrigger = false,
UseCdn = true
}
```

Or shorthand:

```razor
Animate="true" Theme="FloatingTooltipTheme.Dark"
```

---

## ?? Interop Methods

You can control tooltips programmatically via:

```csharp
await tooltipRef.Show();
await tooltipRef.Hide();
await tooltipRef.Toggle();
```