Styling Simple Form forms with Tailwind

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Simple Form

    Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.

    Simple Form gem

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. simple_form_tailwind_css

    Tailwind components for Simple Form

    One option is the simple_form_tailwind_css gem by Abe Voelker, mentioned also in the GitHub issue. It uses a combination of default Tailwind styles in the Simple Form configuration with a custom form builder and a few custom inputs. The gem supports replacing the default classes related to error messages with custom ones.

  4. Tailwind CSS

    A utility-first CSS framework for rapid UI development.

    During our recent redesign of the admin section of our web, we wanted to set up a system that would allow us to quickly build good looking forms. We like to use the Simple Form gem for our forms, we have been using it for nearly 10 years, and we still appreciate its very succinct but flexible syntax. Also, we style our web with Tailwind and we definitely wanted to leverage it for the new admin pages, too. So, at one point of the redesign effort we had to deal with the ”How do we style our new admin forms with Tailwind?“ task and we wanted to do it in the most reusable way possible and without losing Simple Form's flexibility.

  5. Slim

    Slim is a template language whose goal is to reduce the syntax to the essential parts without becoming cryptic. (by slim-template)

    This config sets a ”medium“ font weight for our form labels by default. Now, suppose we want a specific input’s label to be bold instead, we might want to try the following naive approach (we’re using the Slim template notation here):

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Form error in a rails view

    2 projects | /r/rails | 10 Nov 2021
  • A RuboCop Configuration Tailored for Phlex

    4 projects | dev.to | 20 Sep 2024
  • XRB alternatives - Haml, Slim, and Hamlit

    4 projects | 30 Apr 2024
  • Do Modern Programming Languages Have to Care About Line Length?

    2 projects | /r/ProgrammingLanguages | 5 Jun 2023
  • Hotwire Question - Controller Lifecycle

    1 project | /r/rails | 18 Feb 2023

Did you know that Ruby is
the 12th most popular programming language
based on number of references?