Download the PHP package smitmartijn/laravel-lookbook without Composer
On this page you can find all versions of the php package smitmartijn/laravel-lookbook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smitmartijn/laravel-lookbook
More information about smitmartijn/laravel-lookbook
Files in smitmartijn/laravel-lookbook
Package laravel-lookbook
Short Description Laravel Lookbook is a component development environment for Laravel that helps you build, document, and organize your Blade components in isolation.
License LGPL-3.0-or-later
Informations about the package laravel-lookbook
Laravel Lookbook
Laravel Lookbook is a component development environment for Laravel that helps you build, document, and organize your Blade components in isolation. Preview different component states, document usage examples, switch between light and dark modes to verify your components - all while working in your Laravel application. Inspired by the Ruby on Rails Lookbook gem, this package brings the same powerful component development workflow to the Laravel ecosystem.
Features
- Component Previews: Render and display Blade components with their output.
- Multiple Component Versions: Show different versions/states of the same component. (i.e., primary button, secondary button, etc.)
- Source Code Display: View the Blade source code used to render the components.
- Collapsible Folders: Organize components in collapsible category folders
- Light/Dark Mode: Switch between light and dark themes for better visibility.
- Component Generator: Artisan command to scaffold new component previews
- Markdown Documentation: Add markdown-formatted notes to your components
Installation
-
Install the package via Composer:
-
Publish the configuration file and views:
-
Update the configuration file located at
config/lookbook.phpto optionally customize the route and other settings. -
Visit
/lookbookto check out the interface! - Optionally, add
"./app/Lookbook/**/*.php",to thecontentarray intailwind.css.js, if you are going to be using classes in the component preview files.
Usage
- Access the Lookbook interface at the configured route (default:
/lookbook). - Organize your Blade component previews in the
app/Lookbookdirectory. - Create component preview files to define how each component is displayed in the previews.
Creating component previews
-
Create a component preview
- Edit the created component preview model (
app/Lookbook/Button.phpin example) to include the code for your Blade component. For example:
Notes:
- You can have as many functions inside the component preview files as you want.
- The phpdoc block is optional. Without a
@namethe function name will be used as the component preview name. - The component name will be derived from the class name, but you can override it by adding a function to the class:
Contributing
This package is in early stages, and contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
Testing
Run the tests with:
License
This package is licensed under the LGPL-3.0 License. See the LICENSE file for more information.