Feedback Laraform is now in maintenance mode. Read more on our GitHub.

Trix Element

An element used to render a Trix editor.

#Examples

#Options

Name Type Description
accept array Accepted attachment extensions. Example: ['jpeg', 'png', 'gif'].
acceptMimes array Accepted attachment mime types. Example: ['image/jpeg', 'image/png', 'image/gif'].
endpoint string Endpoint to be called to upload attachments.
default string Value of element when the form is initially loaded or reseted.
placeholder string The placeholder of the element.
disabled boolean Whether the field is disabled.

#Properties

Name Type Default Description
disabled boolean false Whether the field is disabled.
accept array [] Accepted attachment extensions. Example: ['jpeg', 'png', 'gif'].
acceptMimes array [] Accepted attachment mime types. Example: ['image/jpeg', 'image/png', 'image/gif'].
endpoint string '...' Endpoint to be called to upload attachments. Defaults to config's config.endpoints.elements
.trix.attachment.
defaultValue string null Value of element when the form is initially loaded or reseted.
placeholder string null The placeholder of the element.
trix$ object null The trix editor's component.

#Methods

# .reset()

Resets the element to it's default state.


# .disable()

Disabled the field.


# .enable()

Enables the field.


#Events

# alert(message)

Parameters
  • message string : message to display.

Triggered when the trix editor fires an alert event (for example not accepted file types). If no event is attached browsers default .alert() method will be used.