# Setting Label Values via a Parent Attribute

Setting label values via a parent attribute is useful if you want control over labels in child components.

Let’s say that you have a container component, which contains another component, inner.cmp. You want to set a label value in inner.cmp via an attribute on the container component. This can be done by specifying the attribute type and default value. You must set a default value in the parent attribute if you are setting a label on an inner component, as shown in the following example.

This is the container component, which contains a default value `My Label` for the `_label` attribute .

```nolang
<aura:component>
    <aura:attribute name="_label" 
                    type="String" 
                    default="My Label"/>
    <lightning:button label="Set Label" aura:id="button1" onclick="{!c.setLabel}"/>
    <auradocs:inner aura:id="inner" label="{!v._label}"/>
</aura:component>
```

This inner component contains a text area component and a `label` attribute that’s set by the container component.

```nolang
<aura:component>
    <aura:attribute name="label" type="String"/>
    <lightning:textarea aura:id="textarea"
                      name="myTextarea"
                      label="{!v.label}"/>
</aura:component>
```

This client-side controller action updates the label value.

```javascript
({
    setLabel:function(cmp) {
        cmp.set("v._label", 'new label');
    }
})
```

When the component is initialized, you’ll see a button and a text area with the label `My Label`. When the button in the container component is clicked, the `setLabel` action updates the label value in the inner component. This action finds the `label` attribute and sets its value to `new label`.

**See Also**

- [Input Component Labels](/docs/platform/aura-platform/guide/labels-overview.md)
- [Component Attributes](/docs/platform/aura-platform/guide/components-attributes.md)
