A tool to help browse, develop, test & document ViewComponents in Ruby on Rails apps.
Lookbook (v1.x) documentation: https://lookbook.build
Looking for v0.9.x docs? Head over here.
Online Demo: https://lookbook-demo-app.herokuapp.com/lookbook
Lookbook's UI is itself built using ViewComponents. To preview these components in a Lookbook instance you can run the included workbench
app:
- Clone this repo
- Install dependencies:
bundle install & npm install
- Start the app:
bin/workbench
- Visit http://localhost:4545/lookbook to view the Lookbook instance
The workbench
app will be started in development mode and any changes to Lookbook's views or assets will immediately be reflected in the UI.
The Lookbook docs site is built using Bridgetown and the source files can be found in the ./docs
directory.
To see a local version of the site run bin/docs
from the root of this repo and then visit http://localhost:4000 in your browser.
Lookbook uses RSpec for testing.
Tests can be run using the rake spec
or bundle exec rspec
commands.
The dummy app that the tests are being run against can be viewed by running the bin/dummy
command and then browsing to http://localhost:9292/lookbook
The gem is available as open source under the terms of the MIT License.