Roll-your-own data-role component

Roll-your-own data-role component

I want to create my own custom, reusable UI-component and figure the best way would be to create my own data-role, like <div data-role="myComponent">Something</div>. Is this supported? Can I create that and just add the necessary CSS and JavaScripts?