# @Decorator **@Decorator** can be applied to variable declarations, class definitions, structure definitions, or method definitions. Multiple decorator implementations can be superimposed on the target element and written on the same line or multiple lines. It is recommended that the implementation be written on multiple lines. In the example below, the elements decorated by **@Component** take on the form of a component, and the variables decorated by **@State** have the meaning of the state data. ``` @Component struct MyComponent { @State count: number = 0 } ``` Multiple decorator implementations can be written on the same line. ``` @Entry @Component struct MyComponent { } ``` However, you are advised to write the decorator implementations on multiple lines. ``` @Entry @Component struct MyComponent { } ``` ## Supported Decorators

Decorator

Decorates...

Description

@Component

struct

The decorated structure has the component-based capability. The build method must be implemented to update the UI.

@Entry

struct

The decorated component is used as the entry of a page. The component is rendered and displayed when the page is loaded.

@State

Primitive types, classes, and arrays

If the decorated state data is modified, the build method of the component will be called to update the UI.

@Prop

Primitive types

The modified state data is used to establish a unidirectional data dependency between the parent component and the child component. When the data associated with the parent component is modified, the UI of the current component is updated.

@Link

Primitive types, classes, and arrays

This decorator is used for bidirectional data binding between parent and child components. The internal state data of the parent component is used as the data source. Any changes made to one component will be reflected to the other.