Phlex is “a framework for building fast, reusable, testable views in pure Ruby”.
Whilst Phlex does not have a concept of a ‘component’ as such but its views can effectively be used to fulfill the same role in an application.
Lookbook enables you to preview Phlex views in isolation for development and testing.
Lookbook assumes that Phlex view files will be stored in the
If that is not the case, you will need to add your Phlex view path to the
component_paths config option:
config.lookbook.component_paths << "path/to/phlex/views"
Phlex components are rendered in preview classes using the
class ArticleViewPreview < Lookbook::Preview
render Views::Article.new(title: "This is a title") do
"This is the body"