# `PhoenixKitWeb.Components.Core.Markdown`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit_web/components/core/markdown.ex#L1)

Renders markdown content safely with consistent styling.

This component parses markdown to HTML using Earmark, sanitizes the output
for XSS prevention, and renders with appropriate styling.

## Usage

    # Full markdown rendering with styling
    <.markdown content={@description} />

    # Compact mode for previews/inline
    <.markdown content={@description} compact />

    # With custom class
    <.markdown content={@description} class="text-sm" />

    # Without sanitization (trusted admin content)
    <.markdown content={@description} sanitize={false} />

## Features

- GFM (GitHub Flavored Markdown) support
- Smart typography (smartypants)
- Code block syntax highlighting classes
- XSS sanitization (enabled by default)
- Compact mode for previews
- Graceful error handling

# `markdown`

Renders markdown content with styling and optional XSS protection.

## Attributes

* `content` - The markdown string to render (required)
* `class` - Additional CSS classes (optional)
* `compact` - Use compact styling for previews (default: false)
* `sanitize` - Enable HTML sanitization (default: true)

## Attributes

* `content` (`:string`) (required) - The markdown content to render.
* `class` (`:string`) - Additional CSS classes. Defaults to `""`.
* `compact` (`:boolean`) - Use compact styling for previews. Defaults to `false`.
* `sanitize` (`:boolean`) - Enable HTML sanitization. Defaults to `true`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
