The majority of components come from our open-source package "Petal Components". However, there are some only in Petal Pro. Ultimately, petal.build will house all docs related to components, and these guides will more tailored to Petal Pro core functionality.
A flash notification component defined in Petal Pro. See docs.
The top dark bit is an animated bar that progresses to the right hand corner, then the box disappears
This comes from flash_group/1 set in your layout:
To see the implementation:
Page components
A set of generic page components to help with building pages. To see a list of them:
Box
Page header
Shows a heading and optional slot for buttons on the right hand side.
Sidebar tabs container
A panel with a sidebar for a menu, and a slot for content on the right.
User dropdown menu
A Petal Pro component. Displays the user's avatar and will show a dropdown menu upon being clicked. Used in the navbar. Displays a list of menu items (see the Menus section).
To see the implementation:
Markdown
Pretty markdown
Renders the markdown as HTML and uses the Tailwind Typography classes to prettify it.
To see the implementation:
Markdown
Simple renders pure HTML from markdown.
Social Button
This is a Petal Pro component. To see its implementation:
<h1>Let's verify your account</h1>
<p>Touch the button below to verify your account</p>
<EmailComponents.button_centered to={@url}>
Verify account
</EmailComponents.button_centered>
<EmailComponents.small_text>
If you didn't create an account with us, please ignore this.
</EmailComponents.small_text>
/lib/petal_pro_web/components/email_components.ex
defmodule PetalPro.Components.EmailComponents do
use Phoenix.Component
def my_new_component(assigns) do
~H"""
Your component HTML goes here
"""
end
end
<h1>Let's verify your account</h1>
<.my_new_component />
<LandingPage.features
title={gettext("Features")}
description={gettext("Here are some features you can use to get started with your web app.")}
features={
[
%{
title: "Authentication",
description: Faker.Lorem.sentence(10..20),
icon: :lightning_bolt
},
%{
title: "HTML Emails",
description: Faker.Lorem.sentence(10..20),
icon: :puzzle
},
%{
title: "Wallaby testing",
description: Faker.Lorem.sentence(10..20),
icon: :at_symbol
}
]
}
/>