К содержимому

SusAlert

SusAlert

Блок inline-фидбека — заголовок и текст, тип severity, опциональное закрытие.

Пакет

SusKit · Атомы (коммерческий)

Открыть в песочнице

SusKit · Atoms

Свойства

ИмяТипПо умолчанию
TypeProp<string>"info"v-model
TextProp<string>""v-model
TitleProp<string>""v-model
IconProp<string>""v-model
ClosableProp<bool>falsev-model
ProminentProp<bool>falsev-model
BorderProp<string>"left"v-model
DensityProp<string>"default"v-model
VariantProp<string>"tonal"v-model

Слоты

Имя
(по умолчанию)

События

ИмяПолеPayload
CloseOnClose

Хуки стиля

Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:

  • sus-alert
  • sus-alert__body
  • sus-alert__close
  • sus-alert__icon
  • sus-alert__text
  • sus-alert__title
  • sus-alert--border-bottom
  • sus-alert--border-left
  • sus-alert--border-right
  • sus-alert--border-top
  • sus-alert--closable
  • sus-alert--density-comfortable
  • sus-alert--density-compact
  • sus-alert--error
  • sus-alert--flat
  • sus-alert--info
  • sus-alert--outlined
  • sus-alert--prominent
  • sus-alert--success
  • sus-alert--text
  • sus-alert--tonal
  • sus-alert--warning
  • unity-label
  • unity-text-element

Использование

xml
<template>
  <sus:SusAlert Type="warning"
                Title="Unsaved changes"
                Text="Leave this screen and you will lose edits."
                Variant="tonal"
                Closable="true"
                @close="OnDismiss" />
</template>

<script>
void OnDismiss() { /* hide or clear */ }
</script>
csharp
var alert = new SusAlert();
alert.Type.Value = "info";
alert.Title.Value = "Sync complete";
alert.Text.Value = "Your loadout is up to date.";
alert.Variant.Value = "tonal";
alert.OnClose += () => { /* … */ };

Тип

info · success · warning · error

Вариант

tonal · outlined · text · flat