Tags on social media app

Hello All!

I have an app with post, comments and users. I would like to create a tags system on the post where the users could set tags while creating the post.
I created a tags table and linked it to the post (many to many).
Now the difficulty is more on the creation of the post. I would like to have something like : the user can select an existing tag or create one if not. I don’t know how to do this, what to use, a dropdown? An input?
For now I have a classic form to create the post.


I was just playing around with creating a similar system. When the user wants to add a tag, I fire a modal with a list that shows all the available tags and toggles for if that tag is applied. At the top of the list I have a text field and a button allowing you to create a new one. In my case, there are only a few options so this checkbox list works fine. For a true tagging system, you could consider a search bar to search all existing tags. Hope this helps!


@joshjohnson thanks a lot! I will try this and go back to you if I have other questions. Indeed I was thinking to the search bar but I don’t know how to do this (to let the user select the tag in the search results or to add the tag writen in the search input)

If you create a list that includes all your available tags, then you can filter that list based on the input of a text field to search your tags. You can also toss in a button to create a new tag in case it doesn’t exist.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.