/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/ListGroupItem.astro
25 строк
871 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 item (.list-group-item). // `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 { /** list-group-item-action (hover/focus affordance, typically for a/button items) */ action?: boolean active?: boolean disabled?: boolean class?: string /** remaining attributes (href, data-*, …) are forwarded to the element */ [key: string]: unknown } const { as: Element = 'div', action, active, disabled, class: className, ...rest }: Props = Astro.props --- <Element class:list={['list-group-item', action && 'list-group-item-action', active && 'active', disabled && 'disabled', className]} {...rest}> <slot /> </Element>