TextMeshPro Array

Hi I’m making in game menu elements with unity’s ui elements but of course texts are looking bad. Anyway, I put a textmeshpro’s text but in the coding, I’m not getting an array to edit ui’s features (getting tags to edit like color or fonts etc.). So how can I use array like in example code for textmeshpro

_inventory_Texts = GameObject.FindGameObjectsWithTag("Inventory_Text");
     foreach (GameObject r in _inventory_Texts)
            {
                Text b = r.GetComponent<Text>();
                b.fontSize = 20;
                b.color = Color.white;
                b.font = (Font)Resources.Load("libel-suit-rg");
                RectTransform a = r.GetComponent<RectTransform>();
                a.offsetMin += new Vector2(60, -60);
    
    
    
            }

Inside your foreach loop, you get the Text component: this is Unity’s UI Text component, not Text Mesh Pro’s. First, make sure you have using TMPro; to access any Text Mesh Pro class and get the correct component. UI is TextMeshProUGUI ; 3D is TextMeshPro .