CloseButton

in namespace DotVVM.Bootstrap5.Controls

Renders a universal close button for modal dialogs and alerts.

Usage & Scenarios

Renders a close button used in Alers, ModalDialog and others.

https://getbootstrap.com/docs/5.2/components/modal/

Sample 1: Close button

Close button control can be used while using custom header templates.

<bs:ModalDialog ScrollableContent="true" IsDisplayed="{value: Displayed}">
  <Content>
      <span>
          Dolore at lorem option no duis est magna erat diam lorem sadipscing eos ea minim justo nonumy dolores tempor vulputate erat amet molestie dolor et dolores at no ipsum at
          eirmod et ut aliquyam sed in rebum dolor et vero sit feugiat et eirmod ullamcorper et invidunt et vero in accusam vulputate amet nulla</span>
  </Content>
  <FooterTemplate>
      <bs:CloseButton data-ui="close-btn-dismissed" Click="{staticCommand: Displayed = false}" />
  </FooterTemplate>
</bs:ModalDialog>
public class ViewModel
{
    public bool Displayed { get; set; } = true;

}

Properties

Name Type Description Notes Default Value
property icon CloseButtonLabel String Gets or sets the text displayed for the screen readers.
attribute
inner element
static value
bindable
default
Close
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True

Events

Name Type Description
event icon Click ICommandBinding Gets or sets the command that will be triggered when the close button is clicked. The `IsDisplayed` property can be set to `false` to close the ModalDialog or Alert control.

HTML produced by the control