/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/Badge.astro
20 строк
547 B
Paweł Kuna
Narrow component prop types, remove unused props and dead code (#2838)
10 авг 2026, 00:14
Не верифицирован
10 авг 2026, 00:14
4f7beec
Код
Авторство
О чём код?
--- import Icon from './Icon.astro' interface Props { text?: string color?: string /** badge-{scale} right after badge */ scale?: string /** -lt colour variant + text-{color}-lt-fg */ light?: boolean class?: string icon?: string } const { text, color, scale, light, class: className, icon } = Astro.props const classes = ['badge', scale && `badge-${scale}`, color && `bg-${color}${light ? '-lt' : ''} text-${color}${light ? '-lt' : ''}-fg`, className] --- <span class:list={classes}>{icon && <Icon name={icon} />}{text}</span>