Phoenix 1.8 framework conventions covering layouts, routing, components, icons, forms, HTTP clients, and design file handling. Use when building or reviewing Phoenix web applications.
mix precommit alias when you are done with all changes and fix any pending issues:req (Req) library for HTTP requests. Avoid :httpoison, :tesla, and :httpc. Req is included by default and is the preferred HTTP client for Phoenix apps<Layouts.app flash={@flash} ...> which wraps all inner contentAppWeb.Layouts module is aliased in the app_web.ex file, so you can use it without needing to alias it againcurrent_scope assign:
current_scope to <Layouts.app>current_scope error by moving your routes to the proper and ensure you pass as neededlive_sessioncurrent_scope<.flash_group> component to the Layouts module. You are forbidden from calling <.flash_group> outside of the layouts.ex modulecore_components.ex imports an <.icon name="hero-x-mark" class="w-5 h-5"/> component for hero icons. Always use the <.icon> component for icons, never use Heroicons modules or similar<.input> component for form inputs from core_components.ex when available. Using it will save steps and prevent errors<.input class="myclass px-2 py-1 rounded-lg">) with your own values, no default classes are inherited, so your custom classes must fully style the inputscope blocks include an optional alias which is prefixed for all routes within the scope. Always be mindful of this when creating routes within a scope to avoid duplicate module prefixesalias for route definitions! The scope provides the alias:scope "/admin", AppWeb.Admin do
pipe_through :browser
live "/users", UserLive, :index
end
The UserLive route would point to the AppWeb.Admin.UserLive module.
Phoenix.View no longer is needed or included with Phoenix, don't use it.pen files directly as JSON blobs. These are design files that must only be modified through the Pencil MCP server tools