# `Backpex.HTML.CoreComponents`
[🔗](https://github.com/naymspace/backpex/blob/0.18.3/lib/backpex/html/core_components.ex#L1)

Provides core components for Backpex.

# `icon`

Renders a Heroicons icon.

## Attributes

* `name` (`:string`) (required)
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted.

# `dropdown`

Renders a dropdown menu component with a trigger and menu content.

## Examples

    <.dropdown id="user-menu">
      <:trigger class="btn btn-primary btn-sm" aria_label="User Menu">
        User Menu
      </:trigger>
      <:menu>
        <li><.link navigate={~p"/profile"} class="menu-item">Profile</.link></li>
        <li><.link navigate={~p"/settings"}>Settings</.link></li>
        <li><.link navigate={~p"/logout"}>Logout</.link></li>
      </:menu>
    </.dropdown>

## Attributes

* `id` (`:string`) (required) - unique identifier for the dropdown.
* `class` (`:any`) - additional classes for the outer container element. Defaults to `nil`.
* Global attributes are accepted. Supports all globals plus: `["phx-*"]`.
## Slots

* `trigger` - the trigger element to be used to toggle the dropdown menu. Accepts attributes:

  * `class` (`:any`) - additional classes for the wrapper of the trigger.
  * `aria_label` (`:string`) - accessible label for screen readers.
  * `aria_labelledby` (`:string`) - accessible labelledby for screen readers.
* `menu` - the dropdown menu. Accepts attributes:

  * `class` (`:any`) - additional classes for the wrapper of the menu.

---

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