Skip to content

How to hide X icon to the top right of Modal #677

Answered by gvreddy04
Sinkira asked this question in Q&A
Discussion options

You must be logged in to vote

@Sinkira Thank you for using BlazorBootstrap.

Set ShowCloseButton="false" to hide the X icon.

Screenshot:

Sample code:

<Modal @ref="modal" Title="Modal title" ShowCloseButton="false">
    <BodyTemplate>
        Modal body text goes here.
    </BodyTemplate>
    <FooterTemplate>
        <Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
        <Button Color="ButtonColor.Primary">Save changes</Button>
    </FooterTemplate>
</Modal>

<Button Color="ButtonColor.Primary" @onclick="OnShowModalClick">Show Modal</Button>

@code {
    private Modal modal = default!;

    private async Task OnShowModalClick()
    {
        await modal.ShowAsync();
    }

    private a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sinkira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants