Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Components: Accordion #92

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions components/accordion/AlwaysOpen.html
Original file line number Diff line number Diff line change
@@ -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/[email protected]/dist/cdn.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/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>
84 changes: 84 additions & 0 deletions components/accordion/Simple.html
Original file line number Diff line number Diff line change
@@ -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/[email protected]/dist/cdn.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/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>