Отображение данных accordiondataglass
Glass Accordion
Группа аккордеонов с глассморфизмом для списков FAQ и раскрывающихся секций.
Живое превью
How do I install the components?
Simply copy the Astro and CSS code into your project.
Is this open source?
Yes, Astro Components is free under the MIT license.
Использование
Скопируйте и вставьте этот код на вашу страницу Astro:
astro
---
import { GlassAccordion } from 'astro-component-kit';
---
<AccordionGroupGlass>Content</AccordionGroupGlass> ---
import { GlassAccordion } from 'astro-component-kit';
---
<AccordionGroupGlass>Content</AccordionGroupGlass> Ручная установка
Если вы не используете пакет npm, создайте файл и вставьте следующий код: src/components/lib/GlassAccordion.astro:
astro
---
---
<div class="acc-wrap">
<details open>
<summary>How do I install the components?</summary>
<div class="content">Simply copy the Astro and CSS code into your project.</div>
</details>
<details>
<summary>Is this open source?</summary>
<div class="content">Yes, Astro Components is free under the MIT license.</div>
</details>
</div>
<style>
.acc-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
details { background: rgba(255,255,255,0.03); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; overflow: hidden; }
summary { padding: 1rem 1.5rem; cursor: pointer; color: #fff; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
summary:hover { background: rgba(255,255,255,0.02); }
summary::after { content: "+"; font-size: 1.25rem; transition: transform 0.3s; }
details[open] summary::after { transform: rotate(45deg); }
.content { padding: 0 1.5rem 1rem; color: #94a3b8; font-size: 0.9rem; line-height: 1.6; }
</style> ---
---
<div class="acc-wrap">
<details open>
<summary>How do I install the components?</summary>
<div class="content">Simply copy the Astro and CSS code into your project.</div>
</details>
<details>
<summary>Is this open source?</summary>
<div class="content">Yes, Astro Components is free under the MIT license.</div>
</details>
</div>
<style>
.acc-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
details { background: rgba(255,255,255,0.03); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; overflow: hidden; }
summary { padding: 1rem 1.5rem; cursor: pointer; color: #fff; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
summary:hover { background: rgba(255,255,255,0.02); }
summary::after { content: "+"; font-size: 1.25rem; transition: transform 0.3s; }
details[open] summary::after { transform: rotate(45deg); }
.content { padding: 0 1.5rem 1rem; color: #94a3b8; font-size: 0.9rem; line-height: 1.6; }
</style>
Краткая информация
- Категория
- Отображение данных
- Имя файла
GlassAccordion.astro- Зависимости
- Нет — чистый Astro + CSS
- Теги
- accordiondataglass