{"id":78563,"library":"view-component","title":"ViewComponent","description":"A framework for building reusable, testable, and encapsulated view components in Ruby on Rails.","status":"active","version":"4.12.0","language":"ruby","source_language":null,"source_url":"https://github.com/viewcomponent/view_component","tags":["rails","view","component","reusable","ui"],"install":[{"cmd":"gem install view_component","lang":"bash","label":"gem install"},{"cmd":"# Gemfile\ngem 'view_component', '~> 4.12.0'","lang":"ruby","label":"Gemfile"}],"dependencies":[],"imports":[{"symbol":"ViewComponent","correct":"require 'view_component'"}],"quickstart":{"code":"require 'view_component'\n\nclass MyComponent < ViewComponent::Base\n  def initialize(name:)\n    @name = name\n  end\nend\n\n# In a Rails view:\n# <%= render(MyComponent.new(name: 'World')) %>","lang":"ruby","description":"Define a simple view component and render it in a Rails template."},"warnings":[{"fix":"Ensure your project meets the minimum Rails and Ruby version requirements.","message":"ViewComponent requires Rails 5.0+ and Ruby 2.7+. Older versions may not be compatible.","severity":"breaking","affected_versions":">= 4.0.0"}],"env_vars":null,"search_vec":"'build':5 'compon':11,18 'encapsul':9 'framework':3 'rail':15,16 'reusabl':6,19 'rubi':13 'testabl':7 'ui':20 'view':10,17 'viewcompon':1","created_at":"2026-06-18T04:22:20.017000+00:00","updated_at":"2026-06-18T04:22:20.017000+00:00","problems":[],"ecosystem":"rubygems","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://viewcomponent.org","github":"https://github.com/viewcomponent/view_component","docs":"http://www.rubydoc.info/gems/view_component/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-12-15","install_tag":null}}