LilyDesignSystem.Blazor.MotionPicker 0.1.0

dotnet add package LilyDesignSystem.Blazor.MotionPicker --version 0.1.0
                    
NuGet\Install-Package LilyDesignSystem.Blazor.MotionPicker -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.MotionPicker" 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.MotionPicker" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LilyDesignSystem.Blazor.MotionPicker" />
                    
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.MotionPicker --version 0.1.0
                    
#r "nuget: LilyDesignSystem.Blazor.MotionPicker, 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.MotionPicker@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.MotionPicker&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LilyDesignSystem.Blazor.MotionPicker&version=0.1.0
                    
Install as a Cake Tool

MotionPicker (Blazor helper)

A reusable Blazor headless motion (reduced-motion) picker — an icon button that opens a dropdown listbox of motion-preference slugs. On every change it sets data-motion="{slug}" on the document root, optionally persisting the choice to localStorage. Ships no CSS — the consumer decides what data-motion="reduce" actually suppresses, e.g.:

:root[data-motion="reduce"] * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

Unlike its ThemePicker and TextSizePicker siblings, MotionPicker's initial value defers to the platform's own (prefers-reduced-motion: reduce) media query before falling back to an arbitrary default.

Usage

@using LilyDesignSystem.Blazor.Helpers

<MotionPicker
    Label="Motion"
    Motions="@(new[] { "no-preference", "reduce" })"
    @bind-Value="motion"
    StorageKey="lily-motion" />

@code {
    private string motion = "";
}

Parameters

Parameter Type Required Description
Label string yes Accessible name (aria-label) for the button + listbox.
Motions IReadOnlyList<string> yes Available motion slugs.
Value string no Selected slug. Two-way bindable via @bind-Value.
DefaultValue string? no Initial slug when nothing else is supplied.
StorageKey string? no If set, persist the slug to localStorage.
Name string no name of the hidden input (default "motion").
MotionLabels IReadOnlyDictionary<string,string> no Pretty labels per slug.
OnChange EventCallback<string> no Called after a new motion preference is applied.
CssClass string no Extra CSS class on the root.
ChildContent RenderFragment<MotionPickerContext>? no Replaces the default glyph inside the button.

Behaviour

Initial value resolves from Value > storage > DefaultValue > the platform's (prefers-reduced-motion: reduce) preference (mapped to "reduce" / "no-preference" if either is in Motions) > Motions[0]. All DOM writes happen through IJSRuntime inside OnAfterRenderAsync, so the component is SSR / prerender safe.

Accessibility

  • WCAG 2.2 AAA target; directly supports 2.3.3 (Animation from Interactions).
  • APG listbox keyboard contract: arrows (clamped), Home / End, PageUp / PageDown (by ten), typeahead with same-character cycling, Escape discards, Tab closes.
  • aria-label carries the consumer-supplied accessible name.
  • Default labels title-case the slug.

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

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
0.1.0 75 9/16/2026