Skip to content

rad leadComponent

Steve Hannah edited this page Jul 9, 2021 · 1 revision

rad-leadComponent attribute

Synopsis

Specifies the leadComponent property of a Container using a selector string that is compatible with ComponentSelector. This attribute was added because the standard leadComponent property is difficult to set in XML, since it requires a reference to the component that is to be set as the lead component, and this component is usually a child of the container, so it can be difficult to reference by other means.

Usage

Generally the lead component will be a button that you want to pipe all events of the container to. Give the button a name so that you can reference it from the rad-leadComponent attribute. In the following example, the <button> with name "MyButton" is targeted as the lead component for the <myContainer> because it is targeted by name in the rad-leadComponent attribute.

<myContainer rad-leadComponent="#MyButton">

    ...
    <button name="MyButton" hidden="true"></button>
</myContainer>

Examples

See Using a Lead Component in the Getting Started tutorial for usage instructions and example.

Clone this wiki locally