Download the PHP package mrshanebarron/code-block without Composer
On this page you can find all versions of the php package mrshanebarron/code-block. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package code-block
Code Block
A syntax-highlighted code block component for Laravel applications. Displays code with optional line numbers and copy functionality. Works with Livewire and Vue 3.
Installation
Livewire Usage
Basic Usage
With Line Numbers
With Copy Button
With Filename
Livewire Props
| Prop | Type | Default | Description |
|---|---|---|---|
language |
string | 'text' |
Programming language |
show-line-numbers |
boolean | false |
Show line numbers |
copyable |
boolean | false |
Show copy button |
filename |
string | null |
Display filename header |
Vue 3 Usage
Setup
Basic Usage
With Options
Supported Languages
Vue Props
| Prop | Type | Default | Description |
|---|---|---|---|
code |
String | '' |
Code content |
language |
String | 'text' |
Language for highlighting |
showLineNumbers |
Boolean | false |
Display line numbers |
copyable |
Boolean | false |
Enable copy button |
filename |
String | null |
Header filename |
Events
| Event | Description |
|---|---|
copy |
Code was copied |
Supported Languages
javascript/jstypescript/tsphppythonhtmlcss/scss/sassbash/shelljsonsqlyamlmarkdowntext(no highlighting)
Features
- Syntax Highlighting: Language-aware coloring
- Line Numbers: Optional line number gutter
- Copy Button: One-click copy to clipboard
- Filename Header: Optional file name display
- Responsive: Horizontal scroll for long lines
Styling
Uses Tailwind CSS:
- Dark background (gray-900)
- Monospace font
- Colored syntax tokens
- Gray line numbers
- Rounded corners
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Tailwind CSS 3.x
License
MIT License
All versions of code-block with dependencies
PHP Build Version
Package Version
The package mrshanebarron/code-block contains the following files
Loading the files please wait ...