Phoenix UI

Phoenix UI home page
  1. Getting Started
  2. Installation: Tailwind CLI

Backdrop

The backdrop component is used to provide emphasis on a particular element or parts of it.

The backdrop signals to the user of a state change within the application and can be used for creating loaders, dialogs, and more. In its simplest form, the backdrop component will add a dimmed layer over your application.

Examples

Below you can view various demos with example markup.

Basic

The component ships with helper JS-based functions for showing/hiding the component.

Invisible

If true, the backdrop is invisible. It can be used when rendering a popover or a custom select component.

Transition Duration

Add a Tailwind-supported duration value for the transition, in milliseconds.

API

API documentation for the component. Learn about imports and available attributes.

Import

There are multiple ways to import components.


    # PhoenixUI macro which imports all components
    use PhoenixUI
    # Or import component individually
    import PhoenixUI.Components.Backdrop
    

Attributes

Below is a list of attributes that can be applied to the component.

Name Type Default Description
HTML attribute any Supports all HTML attributes.
element Any HTML Element div HTML element to use.
extend_class string Adds additional classes.
invisible bool false
open bool false Whether or not to display in open state by default or override.
phx-{any} binding Supports all Phoenix DOM element bindings.
transition_duration integer 300 Tailwind-supported duration value.