🧊Components

The majority of components come from our open-source package "Petal Componentsarrow-up-right". 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.

Layouts

Docsarrow-up-right are on petal.build.

Brand

See the Branding section.

Color scheme switch

<.color_scheme_switch />

The switch to switch between light and dark mode.

Note that for this to work you also need to add this to your <head> . This is installed by default in Petal Pro.

# in your <head>:
<.color_scheme_switch_js />

Email helpers

A set of components for email templates. Kind of like Petal Components, but for emails.

Example usage:

If you want to add your own components, you can edit the following file:

Then add your components:

Now it'll be available in your email templates!

Landing page

A set of landing page related components. For example:

Language select

A dropdown for setting your language.

This is a Petal Pro component. If you want to see how it's coded or modify it to your own needs you can edit this file:

Language options are set in your config.exs:

See translations for more info.

Notification

A flash notification component defined in Petal Pro. See docsarrow-up-right.

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

Shows a heading and optional slot for buttons on the right hand side.

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 Typographyarrow-up-right 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:

Last updated

Was this helpful?