Component with dynamic templates