For version 2021.1 of Unity, you need the UI Toolkit package in order to get the UIDocument component because prior to 2021.2 that’s the only way to get Runtime UI with UI Toolkit.
We’re in the process of publishing a new version of that package (preview.15) and you’ll need that one because the previous one won’t be compatible with that version of Unity (2021.1.16f1) so if you try to install the package and get errors that’s why.
You can follow the instructions in this Forum thread about how to install the package.