Files
tabler/shared/ui/FormHint.astro
T

20 lines
439 B
Plaintext

---
import type { HTMLTag } from 'astro/types'
// Form hint text (.form-hint).
type PolymorphicProps = { as?: HTMLTag }
interface Props extends PolymorphicProps {
class?: string
/** id so a control can reference the hint via aria-describedby */
id?: string | undefined
}
const { as: Tag = 'div', class: className, id }: Props = Astro.props
---
<Tag class:list={['form-hint', className]} {...id ? { id } : {}}>
<slot />
</Tag>