1. <subscription>
    2. <h3>{ props.plan.name }</h3>
    3. <script>
    4. export default {
    5. onMounted(props) {
    6. // Get JS handle to props
    7. const {plan, showDetails} = props
    8. }
    9. }
    10. </subscription>

    Note how we named the show-details attribute, it is written in dash case but it will be converted to camel case inside the this.props object.

    Then we mount the component to the page with a plan configuration object:

    Parent component properties are passed with the riot.mount method and child component ones are passed via the tag attribute.

    1. <account>
    2. <subscription/>
    3. <script>
    4. import Subscription from './subscription.riot'
    5. export default {
    6. components: {
    7. Subscription
    8. }
    9. </account>

    Using the <slot> tag you can inject custom HTML templates in a child component from its parent

    Child component definition

    The child component is placed in a parent component injecting custom HTML into it

    1. <user>
    2. <greeting>
    3. <b>{ text }</b>
    4. </greeting>
    5. <script>
    6. export default {
    7. text: 'world'
    8. }
    9. </user>

    See for slots.

    Slots work only in compiled components, all the inner HTML of the components placed directly in your page DOM will be ignored.

    Riot if, and is directives are not supported on slot tags