BeaconCMS / beacon

Open-source content management system (CMS) built with Phoenix LiveView. Faster render times to boost SEO performance, even for the most content-heavy pages.
https://beaconcms.org
MIT License
888 stars 89 forks source link

[Proposal] Support module components #540

Closed aroyer closed 2 months ago

aroyer commented 3 months ago

Would be nice to support all the core components that come with Phoenix.

For example

<.icon name="hero-x-mark-solid" />
leandrocp commented 3 months ago

That's the objective :)

Any component added in blueprint list, for example the table gets loaded automatically so in this example a <.table> component will be made available to use on template and also on the visual page builder.

But there are 2 issues to solve before we can add all possible components:

  1. Overwrite tailwind classes at runtime. In a regular Phoenix app you can edit the file to change classes and style components as you wish, for eg in this input checkbox https://github.com/phoenixframework/phoenix/blob/4c10bab46c4cd530240129aff682d54d2950b80b/priv/templates/phx.gen.live/core_components.ex#L313 - but that's not very practical so we need to use a project like https://hex.pm/packages/tails or https://hex.pm/packages/twix to allow users overwrite the default style, for eg: <.input type="checkbox" class="text-red-500">

  2. icon in particular requires tailwind plugins which is not yet supported but we working on it.

With that said contributions are welcome even without tailwind class merging. Getting more components like forms and inputs is on the roadmap.

leandrocp commented 2 months ago

@aroyer now we're supporting almost all of them but the problem is that core components from phoenix is not meant to be used in a project like Beacon where you're supposed to override classes and behavior without changing the component itself. We already have the foundation to create components, even from other libraries like Flowbite, but we still need a plugin system to allow us loading such components instead of bundling them into the core beacon. In short, we're moving towards having way more components into beacon as plugins.