来源:docs/kit/components/dialog.md · API 参考

Dialog

何时使用

最小示例

content = Tessell::Kit::Text.new(Tessell::UI::UiKey.root.child(2_u64), "This cannot be undone.")
cancel = Tessell::Kit::Button.new(Tessell::UI::UiKey.root.child(3_u64), "Cancel")
confirm = Tessell::Kit::Button.new(Tessell::UI::UiKey.root.child(4_u64), "Delete",
  Tessell::Kit::Variant::Danger)
dialog = Tessell::Kit::Dialog.new(Tessell::UI::UiKey.root.child(5_u64),
  "Delete item?", content, [cancel, confirm])
dialog.on_close = -> { @dialog = nil; nil }

root.open_dialog(dialog)

行为

无障碍

主题 token

surface 背景、border 边框、focus 焦点环;标题使用 Large 字号;动作区右对齐。

限制