/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/ListGroup.astro
24 строки
824 B
Bartosz-Do
Fix all `pnpm type-check` warnings and restore lost `Props` typing (#2805)
08 авг 2026, 18:35
Не верифицирован
08 авг 2026, 18:35
0085eeb
Код
Авторство
О чём код?
--- import type { HTMLTag } from 'astro/types' // List group container (.list-group). // `as` must stay out of the Props body: Astro's frontmatter scanner bails on a member // literally named `as` and silently falls back to untyped props. type PolymorphicProps = { as?: HTMLTag } interface Props extends PolymorphicProps { flush?: boolean hoverable?: boolean transparent?: boolean class?: string /** remaining attributes (data-sortable, style, …) are forwarded to the element */ [key: string]: unknown } const { as: Element = 'div', flush, hoverable, transparent, class: className, ...rest }: Props = Astro.props --- <Element class:list={['list-group', flush && 'list-group-flush', hoverable && 'list-group-hoverable', transparent && 'list-group-transparent', className]} {...rest}> <slot /> </Element>