BlazorRamp.Core
1.0.6
Prefix Reserved
dotnet add package BlazorRamp.Core --version 1.0.6
NuGet\Install-Package BlazorRamp.Core -Version 1.0.6
<PackageReference Include="BlazorRamp.Core" Version="1.0.6" />
<PackageVersion Include="BlazorRamp.Core" Version="1.0.6" />
<PackageReference Include="BlazorRamp.Core" />
paket add BlazorRamp.Core --version 1.0.6
#r "nuget: BlazorRamp.Core, 1.0.6"
#:package BlazorRamp.Core@1.0.6
#addin nuget:?package=BlazorRamp.Core&version=1.0.6
#tool nuget:?package=BlazorRamp.Core&version=1.0.6
Blazor Ramp Core
The Blazor Ramp project aims to provide a suite of modular, accessibility-first Blazor components. This Core package includes the LiveRegionService, which enables you to make announcements
using the aria-live API via elements with the aria-live attribute, utilising the values polite and assertive to indicate the urgency of each announcement.
The Core package also includes the <AnnouncementHistory /> component, which allows users to view and/or clear a rolling log of the last twenty announcements stored in browser memory.
In addition to the service and component mentioned above, the Core project provides a common set of CSS custom properties that all future components will utilise for their styling. Overriding these CSS properties will therefore update the appearance of all components that rely on them. Each component also exposes non-scoped CSS classes, enabling you to apply custom style overrides where necessary.
Full documentation available at: https://docs.blazorramp.uk
Installation
- Add the BlazorRamp.Core nuget package to your project using the Nuget Package Manager or the dotnet CLI.
dotnet add package BlazorRamp.Core
- Add the following Core stylesheet reference to the
<head>section of your application:
- Blazor Web App / Blazor Server → App.razor
- Blazor WebAssembly → wwwroot/index.html
<head>
<link rel="stylesheet" href="_content/BlazorRamp.Core/assets/css/core.min.css" />
</head>
- Add the following Blazor Ramp Core live region script after Blazors script, as follows:
- Blazor Web App / Blazor Server → App.razor
- Blazor WebAssembly → wwwroot/index.html
<script src="_framework/blazor.web.js"></script>
<script type="module" src="_content/BlazorRamp.Core/assets/js/core-live-region.js"></script>
- Register BlazorRamp services in the Program.cs file (Both server and client if using Server and WebAssembly interactive rendermode)
Add the following line to the service registration section:
@using BlazorRamp.Core.Common.Extensions;
builder.Services.AddBlazorRampCore();
- Add the
<AnnouncementHistory />component with your parameter values above the Router component contained in either:
- Blazor Web App / Blazor Server → Routes.razor
- Blazor WebAssembly → App.razor
<AnnouncementHistory RefreshText="Refresh" ClearCloseText="Clear & Close" CloseText="Close" NoDataText="No announcements"
Title="Recent Announcements" TriggerVisible="true" TriggerText="Alerts" />
<Router AppAssembly . . .
Using the Live Region Service
Inject the ILiveRegionService into your desired component or class and make the appropriate calls by passing the ILiveRegionSerivce.MakeAnnouncement method an announcement object.
@inject ILiveRegionService _liveRegionService
@code{
private async Task MakeAnnouncement()
{
var announcement = new Announcement("The site is now using a dark coloured theme.", AnnouncementType.Info, "Dark Theme Switch", LiveRegionType.Polite);
await _liveRegionService.MakeAnnouncement(announcement);
}
}
Note: Where possible make announcements using LiveRegionType.Polite and keep your messages brief and to the point. Long verbose messages are annoying and just slow the user down.
The announcement object has the following constructor parameters:
- Message - a string value containing the message to be announced.
- AnnouncementType - an enumerated type describing the type category of announcement (for future use) the default is
AnnoucementType.Info, - AnnouncementTrigger - an optional string value with the user friendly display name of the element that triggered the announcement such as 'Save Button'
- LiveRegionType - the urgency of the announcement. Polite announcements wait for the screen reader to finish current speech before announcing where as assertive announcements interrupt the screen reader immediately.
Full documentation available at: https://docs.blazorramp.uk
Screen Reader Browser Combination Tests:
- On Windows 11 - JAWS, NVDA and Narrator each paired with Chrome, Edge and Firefox.
- On macOS (Sequoia) VoiceOver was paired with Safari
- On iPhone, VoiceOver was paired with Safari
- On Android, TalkBack was paired with Chrome
| 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. 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.22)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.22)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.22)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on BlazorRamp.Core:
| Package | Downloads |
|---|---|
|
BlazorRamp.SkipTo
Provides a Skip To content component for the Blazor Ramp ecosystem of accessible components. |
|
|
BlazorRamp.BusyIndicator
A busy indicator that makes everything beneath its overlay inert whilst a task is in progress. Uses the Blazor Ramp Core Live Region Service to infrom screen reader users when the task is complete. |
|
|
BlazorRamp.Switch
A Blazor toggle siwtch component. |
|
|
BlazorRamp.DialogFramework
Modal dialog for the Blazor Ramp ecosystem of accessible Blazor components |
GitHub repositories
This package is not used by any popular GitHub repositories.
Change to the script file to stop an edge case issue with the modal dialog framework that did not toggle the open state of the announcement history dialog correctly. Just made the previous patch more robust.