LilyDesignSystem.Blazor.SearchPicker 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LilyDesignSystem.Blazor.SearchPicker --version 0.1.0
                    
NuGet\Install-Package LilyDesignSystem.Blazor.SearchPicker -Version 0.1.0
                    
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="LilyDesignSystem.Blazor.SearchPicker" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LilyDesignSystem.Blazor.SearchPicker" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LilyDesignSystem.Blazor.SearchPicker" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LilyDesignSystem.Blazor.SearchPicker --version 0.1.0
                    
#r "nuget: LilyDesignSystem.Blazor.SearchPicker, 0.1.0"
                    
#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.
#:package LilyDesignSystem.Blazor.SearchPicker@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LilyDesignSystem.Blazor.SearchPicker&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LilyDesignSystem.Blazor.SearchPicker&version=0.1.0
                    
Install as a Cake Tool

SearchPicker (Blazor helper)

A headless Blazor 10 site-search control: a single-icon button (a bundled magnifying-glass SVG) that opens a dropdown holding a search field and, at its right, a submit button labelled ⏎. Pressing Return in the field, or the ⏎ button, navigates to /?<query> — a search for foo goes to /?foo.

Ships no CSS and no JS file.

The single source of truth is spec/index.md. This file is the human-readable guide.

Install

Add a project reference to LilyDesignSystem.Blazor.SearchPicker.csproj, or the LilyDesignSystem.Blazor.SearchPicker NuGet package (not yet published).

<ProjectReference Include="path/to/LilyDesignSystem.Blazor.SearchPicker.csproj" />

Quick start

@using LilyDesignSystem.Blazor.Helpers

<SearchPicker Label="Search this site"
              InputLabel="Search terms"
              SubmitLabel="Search" />

That is the whole wiring: a search for foo performs a GET to /?foo.

The control needs an interactive render mode — InteractiveServer, InteractiveWebAssembly, or InteractiveAuto. Under static SSR the markup renders but the button cannot open the panel.

Where the search goes

The destination is SearchPicker.SearchHref(query, action):

You type Action Destination
foo "/" /?foo
foo bar "/" /?foo%20bar
a&b "/" /?a%26b
foo "/search" /search?foo

The query is trimmed and encoded exactly as JavaScript's encodeURIComponent would, so spaces and & cannot split or corrupt it, and every Lily catalog builds the same URL. An empty query goes nowhere.

The bare query (/?foo, not /?q=foo) is why the component navigates in C#: a native GET form always sends name=value pairs, so the form's submission is cancelled and the component navigates to the exact URL itself.

In-app routing

By default the component calls NavigationManager.NavigateTo(href, forceLoad: true) — a real GET request. Pass Navigate to route it yourself:

@inject NavigationManager Nav

<SearchPicker Label="Search this site"
              InputLabel="Search terms"
              SubmitLabel="Search"
              Navigate="@(href => Nav.NavigateTo(href))"
              OnSearch="@(e => Console.WriteLine($"searched {e.Query}"))" />

OnSearch fires before navigating, with the trimmed Query and the Href, for analytics or to record the query.

Parameters

Full table in spec/index.md §4.1. Required: Label, InputLabel, SubmitLabel — no English defaults, because every user-facing string is yours to localise. Optional: Placeholder, Value (@bind-Value), Action, Navigate, OnSearch, ChildContent, CssClass, and any unmatched attribute (spread onto the root).

Static helpers

  • SearchPicker.ReturnSymbol — the bare ⏎ (U+23CE).
  • SearchPicker.SearchHref(query, action = "/") — the destination for a query.
  • SearchPicker.NextSearchPickerId() — the per-instance id minter.

Accessibility

  • The icon is aria-hidden; the button's name comes from Label.
  • The dropdown is a real <form role="search"> — a search landmark named by Label — with a real type="search" field and type="submit" button, so Return-to-submit and mobile search keyboards just work.
  • ⏎ is the visible label only: it is aria-hidden, and the submit button's name is SubmitLabel.
  • Opening focuses the field; Escape closes and returns focus to the button; clicking outside or tabbing away closes.
  • See docs/accessibility.md for the tradeoffs, and spec/index.md §9 for where Blazor differs from the canonical Svelte helper.

Styling

Class hooks: .search-picker (root), .search-picker-button, .search-picker-icon, .search-picker-tooltip, .search-picker-panel, .search-picker-form, .search-picker-input, .search-picker-submit, .search-picker-submit-symbol.

The package ships no CSS beyond the icon markup. The root themes/ stylesheets position the panel and lay the field and ⏎ button out in a row.

Tests

From tests/LilyDesignSystem.Blazor.Helpers.Tests, dotnet test — this package contributes 32 cases, one per §7 clause (clauses 10 and 24 have two).


Lily™ and Lily Design System™ are trademarks.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LilyDesignSystem.Blazor.SearchPicker:

Package Downloads
LilyDesignSystem.Blazor.PickerBar

Lily Design System Blazor picker bar: composes link-picker (optional), search-picker, theme-picker, locale-picker, text-size-picker, and share-picker into one page-header row. Headless, SSR-safe, no CSS.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 116 10/16/2026
0.1.0 114 10/5/2026