Deprecated Properties
The @deprecated annotation marks a property declaration as deprecated.
Whenever the property is accessed from outside the component that declares it, the compiler emits a warning that points to the replacement.
This lets a component evolve its public API while giving users a migration path instead of a hard break.
Note:
@deprecatedis experimental and subject to change.
Syntax
Section titled “Syntax”Prefix a property declaration with @deprecated.
Without an argument, the property must have a two-way binding, and the replacement is derived from its target:
@deprecated in-out property <int> old-prop <=> new-prop;slint
An access to old-prop then warns with Please use 'new-prop' instead.
Pass a string literal to provide a custom message when there is no single replacement property:
@deprecated("Compute it from 'new-prop' instead") in-out property <int> older-prop: 42;slint
Example
Section titled “Example”component Inner { in-out property <int> new-prop; @deprecated in-out property <int> old-prop <=> new-prop;
// No warning: accesses within the declaring component are fine. in-out property <int> internal: old-prop;}
export component Example { inner := Inner { new-prop: 42; }
// Warning: The property 'old-prop' has been deprecated. Please use 'new-prop' instead property <int> value: inner.old-prop;}slint
@deprecatedcan only be applied to property declarations.- Without a message, the declaration must use a two-way binding (
<=>) so the replacement can be derived from its target. Otherwise, the compiler reports an error. - The message must be a plain string literal, without any
\{}expressions. - Accessing a deprecated property is only a warning, never an error, so existing code keeps compiling.
- Accesses from within the declaring component do not warn, since that component still needs to implement the property.
© 2026 SixtyFPS GmbH