TypeScript Playground isn’t a fully fledged sandbox solution. It’s merely meant as a simple type explorer that doesn’t need dependencies.
For your use case I would recommend using CodeSandbox instead. It comes with a whole bunch of TypeScript templates to choose from when creating a sandbox. TypeScript Playground also has an export menu where you can open your code in CodeSandbox directly.
The UI is based off of VS Code, so if you’re used to that you will feel just at home.