mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 21:27:06 +04:00
20 lines
457 B
Plaintext
20 lines
457 B
Plaintext
---
|
|
import type { HTMLTag } from 'astro/types'
|
|
|
|
// Helper text under a form control (.form-text).
|
|
|
|
type PolymorphicProps = { as?: HTMLTag }
|
|
|
|
interface Props extends PolymorphicProps {
|
|
class?: string
|
|
/** id so a control can reference the text via aria-describedby */
|
|
id?: string | undefined
|
|
}
|
|
|
|
const { as: Tag = 'div', class: className, id }: Props = Astro.props
|
|
---
|
|
|
|
<Tag class:list={['form-text', className]} {...id ? { id } : {}}>
|
|
<slot />
|
|
</Tag>
|