Merge pull request #92 from sejutaimpian/accordion

New Components: Accordion
This commit is contained in:
Khatab Wedaa
2024-12-30 22:34:08 +03:00
committed by GitHub
2 changed files with 156 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meraki UI Components</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
[x-cloak] {
display: none !important;
}
</style>
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
</head>
<body class="mx-auto max-w-7xl dark:bg-gray-900">
<div class="dark:text-gray-50">
<div x-data="{ isActive: false }" class="border-b dark:border-b-gray-700">
<button type="button" @click="isActive = !isActive"
class="font-medium hover:underline flex justify-between items-center w-full py-4 cursor-pointer">
<span>What is Meraki UI?</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-4 duration-300" x-bind:class="{ 'rotate-180': isActive }">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</button>
<p x-cloak x-show="isActive" x-collapse class="text-sm pb-4">
Meraki UI is a collection of responsive Tailwind CSS components that enhance the user experience of your
website. with
support for RTL languages, and a sleek Dark Mode.
</p>
</div>
<div x-data="{ isActive: false }" class="border-b dark:border-b-gray-700">
<button type="button" @click="isActive = !isActive"
class="font-medium hover:underline flex justify-between items-center w-full py-4 cursor-pointer">
<span>What is Meraki UI?</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-4 duration-300" x-bind:class="{ 'rotate-180': isActive }">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</button>
<p x-cloak x-show="isActive" x-collapse class="text-sm pb-4">
Meraki UI is a collection of responsive Tailwind CSS components that enhance the user experience of your
website. with
support for RTL languages, and a sleek Dark Mode.
</p>
</div>
<div x-data="{ isActive: false }" class="border-b dark:border-b-gray-700">
<button type="button" @click="isActive = !isActive"
class="font-medium hover:underline flex justify-between items-center w-full py-4 cursor-pointer">
<span>What is Meraki UI?</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-4 duration-300" x-bind:class="{ 'rotate-180': isActive }">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</button>
<p x-cloak x-show="isActive" x-collapse class="text-sm pb-4">
Meraki UI is a collection of responsive Tailwind CSS components that enhance the user experience of your
website. with
support for RTL languages, and a sleek Dark Mode.
</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meraki UI Components</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
[x-cloak] {
display: none !important;
}
</style>
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
</head>
<body class="mx-auto max-w-7xl dark:bg-gray-900">
<div x-data="{
activeAccordion: 1,
setActiveAccordion(id) {
(this.activeAccordion === id) ? this.activeAccordion = null : this.activeAccordion = id;
}
}" class="dark:text-gray-50">
<div x-data="{ id: $id('accordion') }" class="border-b dark:border-b-gray-700">
<button type="button" @click="setActiveAccordion(id)"
class="font-medium hover:underline flex justify-between items-center w-full cursor-pointer py-4">
<span>What is Meraki UI?</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-4 duration-300"
x-bind:class="{ 'rotate-180': activeAccordion === id }">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</button>
<p x-cloak x-show="activeAccordion === id" x-collapse class="text-sm pb-4">
Meraki UI is a collection of responsive Tailwind CSS components that enhance the user experience of your
website. with
support for RTL languages, and a sleek Dark Mode.
</p>
</div>
<div x-data="{ id: $id('accordion') }" class="border-b dark:border-b-gray-700">
<button type="button" @click="setActiveAccordion(id)"
class="font-medium hover:underline flex justify-between items-center w-full cursor-pointer py-4">
<span>What is Meraki UI?</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-4 duration-300"
x-bind:class="{ 'rotate-180': activeAccordion === id }">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</button>
<p x-cloak x-show="activeAccordion === id" x-collapse class="text-sm pb-4">
Meraki UI is a collection of responsive Tailwind CSS components that enhance the user experience of your
website. with
support for RTL languages, and a sleek Dark Mode.
</p>
</div>
<div x-data="{ id: $id('accordion') }" class="border-b dark:border-b-gray-700">
<button type="button" @click="setActiveAccordion(id)"
class="font-medium hover:underline flex justify-between items-center w-full cursor-pointer py-4">
<span>What is Meraki UI?</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-4 duration-300"
x-bind:class="{ 'rotate-180': activeAccordion === id }">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</button>
<p x-cloak x-show="activeAccordion === id" x-collapse class="text-sm pb-4">
Meraki UI is a collection of responsive Tailwind CSS components that enhance the user experience of your
website. with
support for RTL languages, and a sleek Dark Mode.
</p>
</div>
</div>
</body>
</html>