Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By petalframeworkv4.18.1MITIn 1 marketplace
Builds, reviews, and themes Phoenix LiveView UI with petal_components HEEx components, keeping new markup on the design system. Covers dark mode and brand themes in Tailwind.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Shadcn-style Phoenix components that AI assistants can actually use.
Live docs · MCP server · Rules for AI tools · vs shadcn
Petal Components gives Phoenix LiveView apps a shadcn-style set of HEEx components: buttons, forms, modals, tables, cards, and more. They are built with Tailwind v4 and work in live or dead views.
The companion piece is a hosted MCP server at mcp.petal.build that exposes every component's real schema to AI coding tools. Install it once and Claude Code, Cursor, Codex, and Windsurf reach for the existing components instead of inventing raw Tailwind markup from training data.
If you have used shadcn in React, you already know the shape. Same idea, composable primitives, you own the patterns, AI tools read the schema and call it correctly. We just write HEEx, not JSX.
# 1. Install the MCP server once
claude mcp add petal --transport http https://mcp.petal.build/mcp
Then in any Phoenix project:
2. Tell your AI: "install petal_components"
The agent calls get_install_instructions on the MCP, applies the changes to your mix.exs, runs mix deps.get, patches assets/css/app.css, and adds use PetalComponents to your web module. Works in umbrella apps and standard Phoenix projects. The AI handles project shape variance the install would otherwise have to special-case.
Cursor, Windsurf, Continue, Codex, and Cline have their own MCP install commands - see https://petal.build/petal-components for snippets per tool.
If you'd rather install yourself, in mix.exs:
def deps do
[
{:petal_components, "~> 4.18"},
# optional - only needed for the chat markdown components (<Chat.markdown>, <Chat.rich_text>)
{:mdex, "~> 0.12"},
# optional - only needed for <.qr_code>
{:eqrcode, "~> 0.2"}
]
end
In assets/css/app.css, directly below the existing @import "tailwindcss" line (Phoenix 1.8 writes @import "tailwindcss" source(none);; keep it and do not add a second one):
@source "../../deps/petal_components/**/*.*ex";
@source not "../../deps/petal_components/lib/petal_components/showcase";
@import "../../deps/petal_components/assets/default.css";
@plugin "@tailwindcss/forms";
If you use <.prose>, also add @plugin "@tailwindcss/typography";. Its styles come from that plugin, which the standalone Tailwind CLI already includes.
In your MyAppWeb module, inside defp html_helpers (LiveViews get their imports from there, not from def html), replace import MyAppWeb.CoreComponents with:
use PetalComponents
import MyAppWeb.CoreComponents, except: [button: 1, icon: 1, input: 1, table: 1]
Phoenix 1.8's generated CoreComponents defines those four names too, and importing both makes the calls ambiguous. Pages from mix phx.gen.live and mix phx.gen.auth call the CoreComponents versions, so update their call sites: <.input label=...> becomes <.field label=...>, <.button variant="primary"> becomes <.button>, and <.table> row actions move from the :action slot into a <:col>. usage-rules.md has the full list, plus the lines to correct in the AGENTS.md that phx.new writes.
In config/config.exs, route form errors through your app's translator, so errors such as "has already been taken" from phx.gen.auth do not render as "invalid value":
config :petal_components, :error_translator_function, {MyAppWeb.CoreComponents, :translate_error}
Register the bundled JS hooks in assets/js/app.js. Many components need them (toasts, dropdowns and popovers, alert dialogs, the combobox, the data table, the date picker, charts, the chat components, the enhanced inputs and more), so spread the whole set once:
import PetalComponents from "../../deps/petal_components/assets/js/petal_components"
const liveSocket = new LiveSocket("/live", Socket, {
params: { _csrf_token: csrfToken },
hooks: { ...PetalComponents }, // merge with your own hooks if you have any
})
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub petalframework/petal_components --plugin petal-designPlugins from other owners that cover similar ground