Blazor.DriverJs 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazor.DriverJs --version 1.0.0
NuGet\Install-Package Blazor.DriverJs -Version 1.0.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="Blazor.DriverJs" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.DriverJs --version 1.0.0
#r "nuget: Blazor.DriverJs, 1.0.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.
// Install Blazor.DriverJs as a Cake Addin
#addin nuget:?package=Blazor.DriverJs&version=1.0.0

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

Blazor DriverJs

C# wrapper for driverjs library

Instalation

Add to head

<link rel="stylesheet" href="_content/Blazor.DriverJs/driverjs.css">

Add to body

<script src="_content/Blazor.DriverJs/driverjs.js"></script>

Examples

Default drive

The DriverStore component is used here to store references to Popovers and to run the drive.

DriverJsPopover is a component that represents a popover in which we specify the step in which it will be called by passing parameters such as title, description, ...

To be able to work with DriverStore we must declare a reference variable to interact with the API.

<button @onclick="async () => await _store.StartDrive()">
    Start drive
</button>

<div class="gallery__wrapper">
    <DriverStore @ref="_store">
        <DriverJsPopover Step="1" Title="It's a fish with a nice hat">
            <img src="https://i.pinimg.com/564x/d5/ba/a9/d5baa9d87ceccbcbb8c679b53dc07293.jpg" alt="">
        </DriverJsPopover>

        <DriverJsPopover Step="2" Title="It's a smiley face." Description="He's very happy...">
            <img src="https://i.pinimg.com/564x/29/70/52/2970520b7069945d60d4d3482691f9d7.jpg" alt="">
        </DriverJsPopover>

        <DriverJsPopover Step="3" Title="And that's a cool smiley face">
            <img src="https://i.pinimg.com/736x/40/bb/da/40bbdac7db3945f95eb9cfe572d36ecd.jpg" alt="">
        </DriverJsPopover>
    </DriverStore>
</div>

@code {

  private DriverStore _store;

}

Highlight

To highlight a single object, we can use the DriverJs service and call the Highlight method by passing it a HighlightModel.

<button @onclick="ClickHandler" @ref="_ref">
    Click me
</button>

@code {

  private ElementReference _ref;

  private async Task ClickHandler()
  {
      await DriverJs.Highlight(new HighlightModel(_ref)
      {
          Title = "Hello World",
      });
  }

}

Preview

record

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.2.2 86 5/14/2024
1.2.1 107 3/16/2024
1.2.0 92 3/16/2024
1.0.1 176 12/22/2023
1.0.0 84 12/21/2023