Hi @im3000 !
Thanks for using Surface!
If the ErrorTag does not fit your needs, you could indeed dynamically add a class to the TextInput component with the class prop like you mentioned.
There is no currently no way to dynamically add a class to a component across the application. A solution could be to create your own TextInput component that is a wrapper for the Surface one, or that delegates the rendering to Phoenix (it is basically what the Surface component does). In that component, you can retrieve the form context and do what you want with it.
Take a look at https://github.com/surface-ui/surface/blob/master/lib/surface/components/form/text_input.ex, I am sure you will find what you need there.
That being said, I am curious how you imagine a “dynamically” class for one component could work? Could you explain us how you imagine the API? It will help us to evaluate the way of implementing this to Surface.






















