Files
tabler/shared/ui/FormText.astro
T

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>