PhoenixKitWeb.Components.Core.MarkdownContent (phoenix_kit v1.7.42)

Copy Markdown View Source

Renders markdown content with consistent styling across the application.

This component provides a styled container for rendered markdown/HTML content, with support for headings, lists, code blocks, blockquotes, tables, and more. Includes dark mode support.

Usage

<.markdown_content content={@rendered_html} />

# With custom class
<.markdown_content content={@rendered_html} class="my-custom-class" />

Features

  • Styled headings (h1-h4)
  • Paragraph spacing and line height
  • Bullet and numbered lists
  • Inline and block code styling
  • Blockquotes
  • Tables
  • Horizontal rules
  • Dark mode support via [data-theme="dark"]

Summary

Functions

Renders HTML content with markdown-appropriate styling.

Functions

markdown_content(assigns)

Renders HTML content with markdown-appropriate styling.

Attributes

  • content - The raw HTML string to render (required)
  • class - Additional CSS classes to apply (optional)

Attributes

  • content (:string) (required) - The raw HTML content to render.
  • class (:string) - Additional CSS classes. Defaults to "".