# Rendering Component in decorativeWidget API

**URL:** https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537
**Category:** Development
**Created:** [March 7, 2017, 10:20am UTC](https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537 "2017-03-07T10:20:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Clement\_Decou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clement_decou/32/67776_2.png) [@Clement\_Decou](https://meta.discourse.org/u/Clement_Decou)
#### Post date: [March 7, 2017, 10:20am UTC](https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537/1 "2017-03-07T10:20:27Z")

</div>

Hello,

I have a component to render ads in my discourse `{{numeramaAdsBlock "side_ad"}}` and i want to render this component inside the sticky sidebar in a topic. So i use decorateWidget to add my component inside the widget “topic-timeline-container”

```
export default {
    name: 'sidebar-topic',
    initialize(container) {

        withPluginApi('0.2', api => {
            api.decorateWidget('topic-timeline-container:before', dec => {
                // rendering my component with params
            });
        });
    },
}; 

```

How can i render my component with the params ? Thanks.

Edit : Up ?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [March 8, 2017, 8:09am UTC](https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537/2 "2017-03-08T08:09:51Z")

</div>

> [@How to render Component inside Widget?](https://meta.discourse.org/t/how-to-render-component-inside-widget/52872/2):
>
> If you have control over what you’re doing, I recommend rendering a widget within a widget rather than a component.

As per above quote looks like component in a widget is not possible. So rendering a component in decorativeWidget API is also not possible I guess.

---

<div class="post-metadata">

### Author: ![Clement\_Decou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clement_decou/32/67776_2.png) [@Clement\_Decou](https://meta.discourse.org/u/Clement_Decou)
#### Post date: [March 8, 2017, 8:18am UTC](https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537/3 "2017-03-08T08:18:37Z")

</div>

Humm thanks for the reply  
I see this topics.. but how can i “override” this “sidebar” without copiying code or rendering incompatible with a new update ? (Without widget)

There is no solution ?

Thanks

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [March 8, 2017, 8:24am UTC](https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537/4 "2017-03-08T08:24:15Z")

</div>

May be you should change your component as widget.

> [@Clement\_Decou](#):
>
> (Without widget)

I don’t have any solution right now.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 26, 2022, 1:02pm UTC](https://meta.discourse.org/t/rendering-component-in-decorativewidget-api/58537/5 "2022-08-26T13:02:57Z")

</div>

This has since changed, so worth investigating:

> [@Render a component within a Widget. (Using select-kit components within plugin code)](https://meta.discourse.org/t/render-a-component-within-a-widget-using-select-kit-components-within-plugin-code/84462/5):
>
> An example of this is available in Discourse itself: [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6#L362](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6#L362) I wasn’t there when widgets were created, but as far as I can tell, it was created for performance reasons at a time where frontend and especially mobile frontend had huge performance issues. And for dev simplicity it was added the possibility to inject components into widgets. You got to understand that Discourse carries s…
