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

Provides a module card UI component for the Modules Overview page.

This component renders a card displaying a system module with a toggle switch,
status badges, action buttons, and optional configuration stats. Each module
can have custom badges, buttons, and stats displayed through slots.

# `module_card`

Renders a module card with header, toggle, status, actions, and optional stats.

## Examples

    <.module_card
      title="Referral Codes"
      description="Manage referral codes for user registration and monitoring"
      icon="🎫"
      enabled={assigns.module_enabled}
      toggle_event="toggle_module"
    >
      <:status_badges>
        <span class="badge badge-success">
          Enabled
        </span>
        <span class="badge badge-outline ml-2">
          Optional
        </span>
      </:status_badges>

      <:action_buttons>
        <.link navigate="/admin/settings/module" class="btn btn-primary btn-sm">
          Configure
        </.link>
      </:action_buttons>

      <:stats>
        <div class="grid grid-cols-2 gap-2 text-xs">
          <div>
            <span class="text-base-content/70">Max per user:</span>
            <span class="font-medium">5</span>
          </div>
        </div>
      </:stats>
    </.module_card>

## Attributes

* `title` (`:string`) (required) - Module title.
* `description` (`:string`) (required) - Module description text.
* `icon` (`:string`) (required) - Emoji icon for the module.
* `enabled` (`:boolean`) (required) - Whether the module is enabled.
* `toggle_event` (`:string`) (required) - Phoenix event name for the toggle switch.
* `toggle_key` (`:string`) - Module key passed as phx-value-key for generic toggles. Defaults to `nil`.
* `show_toggle` (`:boolean`) - Whether to show the toggle switch. Defaults to `true`.
* `toggle_disabled` (`:boolean`) - Whether the toggle is disabled. Defaults to `false`.
* `toggle_hint` (`:string`) - Hint text shown under the toggle when disabled. Defaults to `nil`.
* `stats_title` (`:string`) - Title for the stats section. Defaults to translated "Current Configuration". Defaults to `nil`.
## Slots

* `status_badges` (required) - Status badges to display (left side of actions row).
* `action_buttons` (required) - Action buttons to display (right side of actions row).
* `stats` - Optional stats/configuration section (shown when enabled).
* `info` - Optional informational content rendered between header and actions.

---

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