Compatibility

Ruby & Rails

ViewComponent supports all actively supported versions of Ruby (>= 3.2) and Ruby on Rails (>= 7.1). Changes to the minimum Ruby and Rails versions supported will only be made in major releases.

Template languages

ViewComponent is tested against ERB, Haml, and Slim, but it should support most Rails template handlers.

Bridgetown (Static Site Generator)

Bridgetown supports ViewComponent via an experimental shim provided by the bridgetown-view-component gem. More information available here.

ActionText

Using rich_textarea from ActionText in a ViewComponent will result in this error:

undefined method "rich_textarea_tag"

This is due to ViewComponent not having access to the helpers it needs via ActionText. As a workaround, add the following to your component (or base component):

delegate :rich_textarea_tag, to: :helpers