0.2.0 • Published 2 years ago

turbo-morph v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Getting Started

turbo-morph is a morphdom integration for Turbo Streams. It provides a new Turbo Stream morph action.

Note: Requires Turbo 7.2+

yarn add turbo-morph
// application.js
import * as Turbo from '@hotwired/turbo'

+import TurboMorph from 'turbo-morph'
+TurboMorph.initialize(Turbo.StreamActions)

Example

<turbo-stream action="morph" target="body">
  <template>
    <body data-updated="true">
      <h1>This is the new body</h1>
    </body>
  </template>
</turbo-stream>

children-only option

morphdom exposes a childrenOnly option that can be passed to a morph call.

With Turbo Streams you can apply this option by adding the [children-only] attribute to your <turbo-stream> element.

<turbo-stream action="morph" target="body" children-only>
  ...
</turbo-stream>

Usage with Rails

TBD

Acknowledgments

tubro-morph is MIT-licensed open-source software from Marco Roth.

Turbo is MIT-licensed open-source software from Basecamp.

morphdom is MIT-licensed open-source software from Patrick Steele-Idem

0.2.0

2 years ago

0.1.0

2 years ago

0.1.0-beta.3

2 years ago

0.1.0-beta.5

2 years ago

0.1.0-beta.4

2 years ago

0.1.0-beta.7

2 years ago

0.1.0-beta.6

2 years ago

0.1.0-beta.2

2 years ago

0.1.0-beta.1

2 years ago