Skip to content

alert block

  • shadcn (base)
  • title — Title; type: text; default: "Alert"
  • description — Description; type: text; default: "This is an alert message"
  • variant — Variant; type: select; default: "default"; options: [{"label": "Default", "value": "default"}, {"label": "Destructive", "value": "destructive"}]
  • Field: display.show_when
  • Default: show
  • Truthiness: empty string, null, undefined, false, 0 and the exact strings “false” and “0” are falsy; everything else is truthy
  • (unset) — show (default)
  • authenticated — show only when the viewer is authenticated
  • unauthenticated — show only when the viewer is not authenticated
  • expr:<path> — show when the dotted context path is truthy
  • expr:!<path> — show when the dotted context path is falsy
  • expr:<path> == <path> — show when the two operands are equal; primitive values are compared as strings, an absent or null operand only equals another absent or null operand, and objects compare by identity; either operand may be a whole {{time.}} token
  • expr:<path> != <path> — show when the two operands are not equal under the == comparison
  • expr:<path> == <literal> — quoted strings, numbers, true, false and null are literal operands; bare words remain context paths
  • expr:<operand> < <operand> — ordering also supports <=, > and >=; numeric values and numeric strings compare numerically, other strings lexically; absent values do not order
  • expr:count(<path>) — the length of an array, or zero for absent or non-array values; count is the only supported function
  • expr:(<term>) — parentheses group expressions and may override boolean precedence
  • expr:<term> && <term> — show when both terms hold; each term is one of the expr: forms above
  • expr:<term> || <term> — show when either term holds; && binds tighter than ||, so a || b && c means a || (b && c)
  • <unknown keyword> — show (backwards-compatible fallback)