Open search bar instead of icon in the header of dawn

Topic summary

A user seeks to replace the Dawn theme’s search icon with a visible search bar while maintaining the predictive dropdown functionality. A solution is provided involving custom code modifications to header.liquid and theme.liquid files.

Core Solution:

  • Replace specific code around line 296 in header.liquid with provided markup
  • Maintains predictive search dropdown while displaying the search bar permanently
  • Multiple users confirm the solution works successfully

Follow-up Customizations Addressed:

  • Full-width expansion: Add CSS to theme.liquid using width: 100% !important and max-width: 100% !important
  • Search results alignment: Adjust positioning by changing left: to unset and translateX(50%) to 0%
  • Background color changes: Question raised but not yet answered

Unresolved Issues:

  • Compatibility with mega menu and top-left logo layouts (multiple requests)
  • Mobile version not displaying the search bar
  • Request for updated code (original code may not be visible)
  • Left-aligned search bar positioning
  • Centering and widening the search bar

The thread remains active with several customization requests pending solutions.

Summarized with AI on October 25. AI used: claude-sonnet-4-5-20250929.

Hey,

does anybody know how to get an open search bare instead of an icon in the Dawn theme? But still has the dropdown effect with products coming up when you have finished the title you are looking for. So should still work as normally but just with the bar instead of an icon.

Best regards,

Oliver

3 Likes

Hey @AmetaComputer ,

Can you share the store link and password (if any) ?

Hey,

Thanks a lot for your reply,

The URL is: https://6b0cd1-3.myshopify.com/

And the Code is: Ameta1234

Also is it possible to make the corners curved? :))

Hey @AmetaComputer ,

That nearly exhausted me! It’s gonna be a little tricky so be very careful here alright :blush:

  1. In your theme go to “Edit Code”

  1. In the search bar type “header.liquid” and click on the file “header.liquid” in the “Sections” folder.

  1. Around line 296, look for the following line that says {% render ‘header-serach’, input_id: ‘Search-In-Modal’ %}

  1. Now here’s the tricky part. Replace it with the following. Be very careful not to touch anything else, and then hit “Save”!

      
        {% render 'header-search', input_id: 'Search-In-Modal' %}
      

      
              {%- if settings.predictive_search_enabled -%}
          
        {%- else -%}
          
        {%- endif -%}
      

You should see the changes now.

3 Likes

Thank you so much!!!

Is it possible to hire you for creating a product template for us? haha,

Hi! I just tried this solutions. Still works great! How would I do to expand the search bar full widht? I’ve set the menu as a drawer followed by the logo and then to the right search, account and cart - and would like the search bar to extend all the way to the logo.

Hey @eliamal ,

Please share the link to your store, thanks!

https://www.hjartgruppenshop.se/

Hey @eliamal ,

Go to your theme’s “Edit Code” Option, then in the search bar type “theme.liquid”
Below the tag “” tag paste the following. Screenshot attached for reference.


Screenshot is for reference only, the correct code to paste is the one shown above.

I can’t get it to work. Did I do anything wrong?

Hey @eliamal ,

No. Could you add !important tag for these two

The final code should look like this, you can also remove the previous and replace with this.


That worked! Do you think it’s also possible to get the search results aligned under the box? It looks a bit misplaced now :slightly_smiling_face:

In the very first code, change left: to ‘unset’

and translateX(50%) to 0%

It should look like

left: unset;
transform: translateX(0%);

you’re a legend, thank you!

Hi, this is great and worked for our store! How do I change the background of the search box? not the dropdown menu that comes up with searching, just the actual search. To look like this, instead of white:

KateD199_0-1716438021875.png

Thank you!

my search bar is on the left side can you send me a code to make it work please and thank u.

Is there any way to edit this code and center and widen the search bar in the header?

Is there a way to get the search bar to be centered on the page, and maybe 50% wider? Thank you.

Link for reference: https://www.partyfairfreehold.com/

Can this code by coded for drop down or mega menu with logo in top left?

1 Like

Can you make this work with the mega menu and the top left layout? i’ve tried tweeking a few things but cant get it to work.