How petalframework/petal_components works
Petal Components is a Phoenix LiveView library of composable HEEx UI components, not a standalone application. The main workflow is that a Phoenix developer brings the library into a view and uses its component tags to render interactive UI; chat components are explicitly opted into separately. Its catalogue spans forms, data display, navigation, feedback, and visual effects. The README also describes an external MCP service for AI-assisted component discovery; it is not implemented in this repository. Some component relationships are omitted because the available excerpts do not establish their runtime calls.
Main entry points: petal_components.ex Component API · data_table.ex Data table · state.ex Table state · registry.ex Showcase examples
Components 21
Library entry
- Component API
lib/petal_components.ex
Forms and data
- Form components
lib/petal_components/form.ex - Fields
lib/petal_components/field.ex - File upload
lib/petal_components/file_upload.ex - Filters
lib/petal_components/filters.ex - Data table
lib/petal_components/data_table.ex - Table state
lib/petal_components/data_table/state.ex - List engine
lib/petal_components/data_table/engine/list.ex
Interactive UI
Display and icons
- Outline icons
lib/petal_components/icons/heroicons_v1/outline.ex - Solid icons
lib/petal_components/icons/heroicons_v1/solid.ex
Showcase
- Showcase examples
lib/petal_components/showcase/registry.ex - Chat showcase
lib/petal_components/showcase/chat.ex
Other components
- Phoenix developer
- Hosted MCP
Connections 18
- Phoenix developer → Component API: uses components
README.md - Component API → Form components: imports
lib/petal_components.ex - Component API → Fields: imports
lib/petal_components.ex - Component API → File upload: imports
lib/petal_components.ex - Component API → Filters: imports
lib/petal_components.ex - Component API → Data table: imports
lib/petal_components.ex - Component API → Calendar: imports
lib/petal_components.ex - Component API → Carousel: imports
lib/petal_components.ex - Component API → Combo box: imports
lib/petal_components.ex - Component API → Skeleton: imports
lib/petal_components.ex - Component API → Slider: imports
lib/petal_components.ex - Component API → Tree: imports
lib/petal_components.ex - Component API → Outline icons: aliases icons
lib/petal_components.ex - Phoenix developer → Chat components: opts into
- Data table → Table state: uses state
- Table state → List engine: drives engine
lib/petal_components/data_table/state.ex - Showcase examples → Chat showcase: curates example
- Hosted MCP → Phoenix developer: provides schemas
README.md