How to style an Easy Search input field?


#1

I’ve looked all over but can’t find any examples of how to simply style the Easy Search input field when rendered as an inclusion like: {{> EasySearch.Input index=booksIndex}}

I’ve tried adding a surrounding div with some stylings for a search field, but no luck. Any suggestions on the simplest way to do this? Thanks in advance.


#2

Try to add ‘attributes’ parameter to your EasySearch.Input:

{{> EasySearch.Input index=booksIndex attributes=inputAttributes}}

And then add a helper like this one to your template:

inputAttributes: function () {
  return { class: 'my-class-name' }; 
}

#3

Thank you serg, it worked for me ! :ok_hand: