Transform a string into a slug with Alpine JS and Slugify 🐌
npm install alpinejs-slugTransform a string into a slug with Alpine JS and
Slugify 🐌
``html
defer
src="https://unpkg.com/alpinejs-slug@latest/dist/slug.min.js"
>
`
`shell
npm i -D alpinejs-slug
yarn add -D alpinejs-slug
`
`js
import Alpine from 'alpinejs'
import slug from 'alpinejs-slug'
Alpine.plugin(slug)
Alpine.start()
`
` html`
#### keep-case
Default: false
| Modifier | Value | False | True |
| --------- | ----------- | ----------- | ----------- |
| keep-case | Hello World | hello-world | Hello-World |
#### replacement
Default: -
If you wanted to use an underscore you'd do so like this replacement._
#### not-strict
Default: false
| Modifier | Value | False | True |
| ---------- | ------------ | ----------- | ------------ |
| not-strict | Hello World! | hello-world | hello-world! |
#### untrimmed
Default: false
If this modifier is added and the string contains spaces, the spaces will be
replaced with the value of replacement.
#### locale
Default: {}
Set the locale to change how certain characters are transformed. You can see the
list on the
Slugify repo.
#### lazy
Prevents the x-slug input value changing on load. It will only change when thex-slug` is targeting changes.
input



