With verbs:
With nouns:
With demonstratives:
The grammar structure とおりに expresses doing something in the same way as, just as, or according to something else. It comes from the noun とおり通り (とおり), meaning "way" or "manner," combined with the particle に. It indicates that an action is performed in exact accordance with a model, instruction, expectation, or prior action.
When used with verbs, とおりに can follow either the past tense (た-form) or the dictionary form. The past tense emphasizes something that was already done, seen, or heard, while the dictionary form focuses on following a general method or instruction.
When used with nouns, the structure becomes Noun + の + とおりに.
とおりに is used with demonstratives like この, その, and あの.
とおりに with the particle に is used when it modifies a verb (as an adverb). とおり without に can appear at the end of a clause or before だ/です to confirm that something is as expected.
Here, とおり functions as a noun (predicate), so に is not needed.