PHP Classes

File: resources/views/components/dropdown.blade.php

Recommend this page to a friend!
  Classes of Nyi Nyi Lwin  >  mtube  >  resources/views/components/dropdown.blade.php  >  Download  
File: resources/views/components/dropdown.blade.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: mtube
Application to share videos between users
Author: By
Last change:
Date: 4 months ago
Size: 1,316 bytes


Class file image Download
@props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white'])

switch ($align) {
    case 'left':
        $alignmentClasses = 'origin-top-left left-0';
    case 'top':
        $alignmentClasses = 'origin-top';
    case 'right':
        $alignmentClasses = 'origin-top-right right-0';

$width = "w-{$width}";


<div class="relative" x-data="{ open: false }" @click.away="open = false" @close.stop="open = false">
    <div @click="open = ! open">
        {{ $trigger }}

    <div x-show="open"
            x-transition:enter="transition ease-out duration-200"
            x-transition:enter-start="transform opacity-0 scale-95"
            x-transition:enter-end="transform opacity-100 scale-100"
            x-transition:leave="transition ease-in duration-75"
            x-transition:leave-start="transform opacity-100 scale-100"
            x-transition:leave-end="transform opacity-0 scale-95"
            class="absolute z-50 mt-2 {{ $width }} rounded-md shadow-lg {{ $alignmentClasses }}"
            style="display: none;"
            @click="open = false">
        <div class="rounded-md ring-1 ring-black ring-opacity-5 {{ $contentClasses }}">
            {{ $content }}

For more information send a message to info at phpclasses dot org.