Blazor playground

Nova v3.38.0

Preview

Blazor

nv-dialog migration

Moving modalTitle into the dialog header and dropping iconColor.

← nv-dialog

Migrating dialogs in Blazor

NvModal became NvDialog. A modal is a behavior; the dialog is the component that provides it. Its header and footer are separate components.

Move the modal title into the header#

Before:

razor<NvModal ModalTitle="Modal" />

After:

razor<NvDialog>
  <HeaderSlot>
    <NvDialogheader Heading="Modal" />
  </HeaderSlot>
</NvDialog>

Replace IconColor with a custom header#

Headers no longer supply a default icon. Provide the icon and heading together in HeaderSlot. Because the body accompanies named fragments, place it in ChildContent.

razor<NvDialog>
  <TriggerSlot>
    <NvButton>Dialog warning</NvButton>
  </TriggerSlot>
  <HeaderSlot>
    <div class="flex items-center gap-2">
      <NvIcon Name="NvIcon.NameEnum.bulb" />
      <h4>Title</h4>
    </div>
  </HeaderSlot>
  <ChildContent>
    <p>This dialog has a custom header containing an icon and a title.</p>
  </ChildContent>
</NvDialog>