In SXA we have components like the Rich Text component that have a version with a local datasource and a reusable version that gets a datasource from a global (site) folder.
This all works fine and I can see local data folders being created and text items appearing in the global site data folders under "Texts".
If I understand correctly the only real difference between the two versions of the RichText component is on creation - the local one doesn't ask anything and creates a local data item, the reusable one does ask for a datasource.
So my question is: how can I use this behavior in my custom rendering? What are the steps I need to take to have a local and reusable version of my custom control?