I would like you to be more concise in the same post. If you would like to build a comparator with a hysteresis, then you can think of a topology based on what kind of supply you have.
If you have dual supply +VDD and -VDD, then it's easier to design using the usual topologies mentioned online which has an opamp driving a resistor divided in its feedback to its positive terminal. The input is given to its negative terminal.
But if you have only a single supply, then there are a couple of ways you can do this :
1)
http://louissimons.com/blog/implementing-comparators-with-hysteresis 2) Switch your reference based on your output using switches. Select a lower reference the moment your input crosses the upper threshold. When your input crosses your upper threshold, your output will be high or low based on your design. So select the lower reference using your outputs.
Now rise fall times of the outputs depend purely on the driving capability of your inverter in the output.
Now that you need to only design the opamp, you use a simple differential amplifier followed by a common source stage. Why two stages? Because you need gain. Why CS output stage? Because you need rail to rail swing which nothing else can provide. You can have inverters followed by CS which can boost the switching. You don't care about the stability of the circuit because this is inherently made a positive feedback circuit.
What are the challenges? You need to design the opamp input pair/current sources to be in saturation for the ranges of common mode, which is the Vih and Vil.
Now if you select architecture 1) then your vih and vil are function of your supply and hance you need to be careful while simulating and assuming their values. In the 2) you could generate a reference based on IR which will have random variation rather than systematic variation.
Check your opamp input referred offset which will also decide your effective Vih and Vil.