Yes, it is entirely possible to create a Dynamic Component that will behave as you describe.