Skip to content

AuthModalContent

AuthModalContent

Sign-in / register panel — username + password fields, error alert, submit/cancel, optional switch link; busy overlay via SetBusy.

Package

SusGame · Screens (commercial)

Open in Playground

SusGame · Screens

Props

NameTypeDefault
TitleTextProp<string>""
SubmitLabelProp<string>"Sign in"
ErrorTextProp<string>""
SwitchLabelProp<string>""

Slots

No slots.

Events

No public events.

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • auth-modal-content
  • auth-modal-content__panel
  • sus-flow-actions-row
  • sus-flow-btn--mr12
  • sus-flow-link--footer

Usage

Wire host clicks on public buttons / link after mount. Bind labels and error text with Prop<>.

xml
<template>
  <sus:AuthModalContent
    :TitleText="Title.Value"
    :SubmitLabel="Submit.Value"
    :ErrorText="Error.Value"
    :SwitchLabel="Switch.Value"
  />
</template>

<script>
public Prop<string> Title = new("Sign in");
public Prop<string> Submit = new("Sign in");
public Prop<string> Error = new("");
public Prop<string> Switch = new("Create account");
</script>
csharp
var auth = new AuthModalContent();
auth.TitleText.Value = "Sign in";
auth.SubmitLabel.Value = "Sign in";
auth.SwitchLabel.Value = "Create account";
auth.ErrorText.Value = ""; // non-empty shows SusAlert
// After mount:
auth.SubmitBtn.OnClick += () => { /* login */ };
auth.CancelBtn.OnClick += () => { /* dismiss */ };
auth.SwitchLink.OnClick += () => { /* flip mode */ };
auth.SetBusy(true, "Signing in…"); // overlay + disables fields
auth.SetBusy(false);
Prop / APIRole
TitleTextHeading (SusBanner)
SubmitLabelPrimary button label
ErrorTextError alert text; empty → hidden
SwitchLabelFooter link text
UsernameField / PasswordFieldBuilt SusTextfield hosts
SubmitBtn / CancelBtn / SwitchLinkWire host actions
SetBusy(busy, message?)SusServerBusyOverlay + disable controls

Notes

  • Built lazily in Created / EnsureBuilt — fields are null until then.
  • Password field is created with password: true.
  • Prefer host screens/modals that own navigation; this is content only (no route logic).