RichText
extends Component
in package
RichText Laravel Blade Component
A rich text editor component with customizable toolbar options. Features customizable labels and read-only mode for enhanced user experience.
Features:
- Customizable toolbar options
- Read-only mode
- Form validation integration
- Livewire real-time updates
- Bulma CSS framework integration
- Mobile-friendly responsive design
Livewire Integration:
IMPORTANT: The component handles Livewire communication through custom events.
Events Dispatched:
-
Livewire:ChangeRichText:{{ $name }}- Fired when rich text content changes Payload: { delta: object } -
CustomEvent:StartRichEdit:{{ $name }}- Fired when editing starts Payload: none -
CustomEvent:DoneRichEdit:{{ $name }}- Fired when editing is completed Payload: none
Events Listened For:
-
Livewire:LoadContent:{{ $name }}- Load content into the editor Payload: { content: object } (where content is the delta) -
Livewire:DisposeContent:{{ $name }}- Dispose/clear the editor content Payload: none
Table of Contents
- $content : mixed
- $label : string|null
- $livewire : bool
- $name : string
- $readOnly : bool
- $toolbarOptions : array<string|int, mixed>
- __construct() : mixed
- Create a new component instance.
- render() : View|string
- Get the view / contents that represent the component.
Properties
$content
public
mixed
$content
= null
$label
public
string|null
$label
= null
$livewire
public
bool
$livewire
= true
$name
public
string
$name
$readOnly
public
bool
$readOnly
= false
$toolbarOptions
public
array<string|int, mixed>
$toolbarOptions
= []
Methods
__construct()
Create a new component instance.
public
__construct(string $name[, mixed $label = null ][, bool $readOnly = false ][, mixed $content = null ][, bool $livewire = true ][, mixed $fonts = null ]) : mixed
Parameters
- $name : string
-
Name of the field, will be used for the event communication
- $label : mixed = null
-
Label of the field or false
- $readOnly : bool = false
-
Read only or not
- $content : mixed = null
-
Content of the field
- $livewire : bool = true
-
Livewire or not
- $fonts : mixed = null
-
Fonts to be used in the rich text editor
Return values
mixed —render()
Get the view / contents that represent the component.
public
render() : View|string