SusPromptDialog

Text prompt card for modal dialogs — single text field with Confirm/Cancel actions; awaitable ShowAsync resolves to the entered string (or null on cancel).
Package
SusKit · Molecules (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
Title | Prop<string> | "Prompt" | |
Placeholder | Prop<string> | "" | v-model |
ConfirmLabel | Prop<string> | "OK" | |
CancelLabel | Prop<string> | "Cancel" | |
Value | Prop<string> | "" | v-model |
Slots
No slots.
Events
| Name | Field | Payload |
|---|---|---|
Confirm | OnConfirm | string |
Cancel | OnCancel | — |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-prompt-dialogsus-prompt-dialog__footer
Usage
xml
<template>
<sus:SusPromptDialog Title="Rename loadout"
Placeholder="Loadout name"
:Value="Name.Value"
@confirm="OnConfirm"
@cancel="OnCancel" />
</template>
<script>
public Prop<string> Name = new("");
void OnConfirm(string value) { /* value == current textfield content */ }
void OnCancel() { }
</script>csharp
// Awaitable helper — hosts the card inside a SusModal and resolves when it closes.
string name = await SusPromptDialog.ShowAsync(
title: "Rename loadout", placeholder: "Loadout name", initialValue: "Scout");
if (name != null) { /* confirmed, name is the entered text */ }Notes
Valueseeds the innerSusTextfield(outlined / comfortable) and stays mirrored two-way while the dialog is mounted — read it back afterOnConfirm, or use the fired value directly.OnConfirm(string)fires with the current textfield value on the confirm button;OnCancel()fires on the cancel button.- The static
ShowAsynchelper wraps the card in aSusModalhost viaSusModalServiceand resolves tonullwhen the dialog is dismissed through the modal scrim.