Files
tabler/shared/ui/HrText.astro

17 lines
548 B
Plaintext

---
interface Props {
text: string
/** hr-text-{position} (core/scss/ui/typo/_hr.scss); center is the default look and emits no class */
position?: 'start' | 'center' | 'end' | undefined
class?: string
/** remaining attributes (id, data-*, aria-*, …) are forwarded to the root element */
[key: string]: unknown
}
const { text, position, class: className, ...rest } = Astro.props
const classes = ['hr-text', position && position !== 'center' && `hr-text-${position}`, className]
---
<div class:list={classes} {...rest}>{text}</div>