Top Tweets for #viewcomponent
One template per state, and no if/else in your ERB.
Rails partials accept a variants: option, so the appointment’s state can pick the template. It works inside a ViewComponent too.
New state? Add a file.

The question is WHY ?
We have ERB and it has 1000 tools around it.
The IDE know it, the LLM trained on it, gazillion tutorial online.
We even have component libraries : Cell, ViewComponent, ect ...
When i want to happy, i write ruby.
When i want to feel depressed, i write javascript.
If i wanted to be a terrorist, i will author a library like this.
That library was authored 10 years late... It was good idea, in 2016.
Since January, I’ve been overhauling the docs for all 52 Rails Blocks component sets I released in 2025.
And this huge update is finally ready! In Rails Blocks, you now get:
- ViewComponent support
- Shared partials support
- Markdown docs v1
Building a custom audio player with Rails? Video gets all the love, but audio deserves better UX too. Here's how to create one with Stimulus for controls and ViewComponent for modularity, complete with responsive waveform visualization and customizable features.

@mjblacker Actually, that’s a great point about buttons and small alterations. That’s probably why ViewComponents never really grew on me. It felt like wasting time tinkering with abstractions instead of just getting things done.
@acetinick What is ButtonComponent? Is it made with ViewComponent?
I’m using default Rails and trying to minimize dependencies. With this setup, I can reuse the CSS anywhere (which I already do). I’m not sure how a ButtonComponent would help.
@ju_uniorr Sounds awesome but is it? Or will this result in partial hell since partials are still costly? Maybe another case for ViewComponents?
It's one of the oldest and thus probably the most mature one. Even Twitter was built with it, although they've moved away from it at least for the frontend part. But since v7 (now it's v8), with the Hotwire integration, you can do the same frontend stuff as with React or Vue, too, like interactive SPAs, but with much less overhead. Github, which is also built with Rails, developed a ViewComponent system and if adding the Reflex gem, you can even directly access the db from the frontend JS (Stimulus Controllers). It's blazingly fast, has top-notch security built-in, is modular, extensible, all OOP, has elegant and easy to use Python-like Syntax and an active community (which is, unfortunately, smaller than most of the others but even more so experienced). I've been working with Rails since 2005 or 6, v1 I think. My last project was with Laravel, which is more or less a copy of Rails in PHP, but lacks important core features, is unnecessarily complicated and has the ugly PHP syntax. I hated it, and I will return to Rails again for my next projects. Laravel does have a good ecosystem, though, with Herd and Forge. I'm currently working on replicating these with some major improvements for Rails. You will be able to create, deploy and grow an SAAS in no time.
It's wrong to look at it as "either Components OR templates/partials/helpers".
ViewComponents are just an additional tool that let you beautifully scope ruby & html. Not a substitute.
@specialCaseDev My one person dev team has converted almost his whole project to ViewComponents and it is wonderful. Faster, more stable and a lovely domain model.
It is not the place to start however but I absolutely recommend it once things are stable. Claude can do most of it really well.
I tried ViewComponent all this week, but now I'm going back to basics: templates, partials, and helpers.
I'll deal with the "globalness" tradeoff because I love the simplicity. My one-person dev team says its worth it!
@jenseickmeyer Partials + viewcomponents is a fantastic duo.
ViewComponents for all stuff that is generic/reusable and partials for everything that is one-of and doesn't require complex view logic.
@jenseickmeyer I would go for ViewComponents for everything. Easy to test, storybook support, and just as in React the main idea is “pure function”.
What is your recommendation for implementing a Design System in a Ruby on Rails application?
- Partials
- View Helpers / Form Builders
- ViewComponents
- Something else?
This feels a lot like "ViewComponent" without any gems, just default rails partials.
You can render any object like this:
<%= render object %>
And it will use the partial defined at "to_partial_path"
class MyObject
def to_partial_path = "objects/my_object"
end
It depends on the project domain, type, and size of the team.
These days, for projects I start;
vite_rails
inertia_rails
ViewComponent
authentication-zero
js-routes
dry-effects
dry-initializer
dry-monads
anyway-config
noticed
database_consistency
... & others...
There are many others - it depends.
Two books I highly recommend are "The Rails Way" by @obie & co and "Layered Design for Ruby on Rails Applications" by @palkan_tula
Also, I'll reach for some of the @evilmartians gems.
@sm_startups Rails components could easily be mistaken for Rails ViewComponents. Intended?
@dailson_igo Yes I use the Component helper the same as the suggestion . Cleaner code in the view
Also Ken Greeff has an introduction video about ViewComponents too
Today I made the switch to using ViewComponents
and I felt the same joy as I felt generating my first Rails models
ViewComponents seems close to the Rails way then using Phlex
My plan is to create a components library and use it for all my future apps
Enhance it with TailwindCSS and Stimulus Js
I need more contributors to this - I have big plans for this lib in the future but it's going to take me time to properly invest in the full, sync'd port of @shadcn ecosystem and tooling to @rails powered by Hotwire and expressed through ERB, @ViewComponent and Phlex. I want to go as far as to ensure that shadcn-rails works with Hotwire Native and will eventually rope @joemasilotti into helping me with that. But it'll take time and one step at a time.
I'm loving the daily adventure of exploring new tech:
Huginn's automation agents in Ruby
Plutonium for rapid application dev
Kamal simplifies deployment
ViewComponents for a cleaner UI
Css Zero's and Admin Zero
Solidus vs Spree for e-commerce
Inertia in Rails (Vue ? Maybe )
I'll try them and do a review on each one of them
What are some new libraries you're looking to explore?
I agree the Rails front-end is relatively low leverage compared to what other frameworks offer these days.
There’s a few integration bits that I tnink need to be improved first, which is why you see me creating libraries like https://t.co/iq2ro9ddum and https://t.co/jMNrnUpcVL to deal with some of the lower level UI integration issues.
Superview will be how people render components from controllers and Superform makes it possible to build forms from components, which you can’t really do in Rails today in a sane manner.
One big challenge when saying, “Rails form helpers are not that great”—it seems as outrageous as saying, “I invented the question mark”. I don’t expect much to improve at the community level until more people have this revelation.
The next layer above the improved helpers/integration would be integrating UI libraries like DaisyUI, shadcn, etc. by way of Phlex or ViewComponent.
Theres a whole new world I’m living in these days where controllers can be simplified if they can reason about views in certain ways, like using a Superform to permit parameters.
Ultimately I think something more productive than Rails could ship. Maybe it’s Rails itself if that community sees the world the same way, or maybe it something like https://t.co/LDyXxlh9yE that’s built on top of Rails that leaves behind the creaky parts.
I used it all: ERB, jQuery, React, Vue, Angular, ViewComponent. For most Rails apps, a frontend framework feels like overkill. BUT I've always missed the ability to extract small pieces of HTML into methods—until I found Phlex!
But am I blind to any downsides? Thoughts?

here's how I threw together a shadcn-style `cn` helper for safely overriding classes in Phlex (or ViewComponent if that's your thing) components using class_names and the tailwind_merge gem from @gjtorikian
https://t.co/GfSoWgwYEq

Last Seen Hashtags on Sotwe
PoliceMiscunduct
Seen from Malaysia
aseguirmejorando
Seen from Indonesia
FríoCostero
nl
Seen from Argentina
unecpected ********
Seen from Italy
DirectorVamshi
Seen from Korea
rape(*)
Seen from United Kingdom
耳光
Seen from United States
LEARNINGNEWTHINGS
Seen from United States
揉胸
Seen from United States
Most Popular Users

Elon Musk 
@elonmusk
239.3M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.6M followers

X 
@x
60.6M followers




















