You can use the css binding. It can be used two ways. Either with a dynamic class (or list of classes):
<li data-bind="css: name"></li>
or with individual classes bound against truthy/falsy values to indicate whether that are should be added/removed from the element:
<li data-bind="css: { classOne: hasClassOne, classTwo: hasClassTwo }"></li>