--- title: Bindings --- ### Bindings As we've seen, data can be passed down to elements and components with attributes and [props](guide#props). Occasionally, you need to get data back *up*; for that we use bindings. #### Component bindings Component bindings keep values in sync between a parent and a child: ```html ``` Whenever `childValue` changes in the child component, `parentValue` will be updated in the parent component and vice versa. If the names are the same, you can shorten the declaration: ```html ``` > Use component bindings judiciously. They can save you a lot of boilerplate, but will make it harder to reason about data flow within your application if you overuse them. #### Element bindings Element bindings make it easy to respond to user interactions: ```html

Hello {name}!

``` ```json /* { hidden: true } */ { name: 'world' } ``` Some bindings are *one-way*, meaning that the values are read-only. Most are *two-way* — changing the data programmatically will update the DOM. The following bindings are available: | Name | Applies to | Kind | |-----------------------------------------------------------------|----------------------------------------------|----------------------| | `value` | `` `