ui-ingredients
Version:
Headless component library for Svelte powered by zag
32 lines (31 loc) • 673 B
JavaScript
import { parts } from './alert-anatomy.js';
export function createAlert() {
function getRootProps() {
return {
role: 'alert',
...parts.root.attrs,
};
}
function getTitleProps() {
return {
...parts.title.attrs,
};
}
function getDescriptionProps() {
return {
...parts.description.attrs,
};
}
function getIndicatorProps() {
return {
'aria-hidden': true,
...parts.indicator.attrs,
};
}
return {
getRootProps,
getTitleProps,
getDescriptionProps,
getIndicatorProps,
};
}