mbta_metro
v0.0.16
Published
A Phoenix LiveView component library
Downloads
1,057
Readme
MBTA METRO
This package contains default styles as well as LiveView Hooks for LiveComponents.
Usage
Install the Elixir package first.
Then, add the mbta_metro library to your assets/package.json
:
%> cd assets
%> npm install --save mbta_metro
You can then use some defaults in your assets/tailwind.config/js
:
const {colors, content, fontFamily, plugins, safelist} = require("mbta_metro")
module.exports = {
content: [
...content,
],
safelist: [
...safelist,
],
plugins: [
...plugins,
],
theme: {
extend: {
colors: {
...colors
}
},
fontFamily: {
...fontFamily,
},
}
}
If you want to MbtaMetro's LiveComponents, you'll need to add its hooks in your assets/js/app.js
:
import {Hooks} from "mbta_metro"
let liveSocket = new LiveSocket("/live", Socket, {
hooks: {
...Hooks
}
})
If you want to include hooks individually, you can do so:
import {Map} from "mbta_metro"
let liveSocket = new LiveSocket("/live", Socket, {
hooks: {
Map
}
})