Registry / web-framework / view-component

view-component

JSON →
library4.12.0rbrubygemsunverified

A framework for building reusable, testable, and encapsulated view components in Ruby on Rails.

gem install view_component
INSTALL
IMPORT
SIG · VIEW-COMPONENT
V
view-component
web-frameworkrubyv4.12.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ViewComponent
require 'view_component'

Define a simple view component and render it in a Rails template.

require 'view_component' class MyComponent < ViewComponent::Base def initialize(name:) @name = name end end # In a Rails view: # <%= render(MyComponent.new(name: 'World')) %>
Debug
Known issues
breakingViewComponent requires Rails 5.0+ and Ruby 2.7+. Older versions may not be compatible.
fix
Ensure your project meets the minimum Rails and Ruby version requirements.
affects: >= 4.0.0
Upgrade
Version history
4.12.0latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
view-component — gem install view-component · libregistry