Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.33 KB

README.md

File metadata and controls

62 lines (41 loc) · 1.33 KB

Phoenix.WebComponent

release

Collection of helpers to generate and manipulate Web Component.

Although this project was originally extracted from Phoenix, it does not depend on Phoenix and can be used with any Plug application (or even without Plug).

See the docs for more information.

About at Web Component

Install

Add deps in mix.exs

    {:phoenix_webcomponent, "~> 2.0"},

Include in phoenix view helpers

 defp view_helpers do
    quote do
        # import all helper functions
        use Phoenix.WebComponent

        # or 
        use Phoenix.WebComponent, :alias
        ...
    end
end

Include javascript

import 'phoenix_webcomponent';

By default, javascirpt is at priv/static/phoenix_webcomponent.js and bundle all packages.

If you wannt better javascript bundle, you can use npm version.

npm install phoenix_webcomponent

All helpers

  • wc_appbar
  • wc_markdown
  • wc_pagination
  • wc_table

Live Storybook

Live Storybook