mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 21:27:06 +04:00
24 lines
820 B
Plaintext
24 lines
820 B
Plaintext
---
|
|
import type { HTMLTag } from 'astro/types'
|
|
|
|
// List group item (.list-group-item).
|
|
|
|
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]} aria-disabled={disabled ? 'true' : undefined} tabindex={Element === 'a' && disabled ? -1 : undefined} {...rest}>
|
|
<slot />
|
|
</Element>
|