/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/Offcanvas.astro
26 строк
1 KB
Paweł Kuna
Narrow component prop types, remove unused props and dead code (#2838)
10 авг 2026, 00:14
Не верифицирован
10 авг 2026, 00:14
4f7beec
Код
Авторство
О чём код?
--- // Offcanvas container (.offcanvas). Renders inline at the call site (unlike Modal, which drains to the end of body). interface Props { /** core/scss/bootstrap/_offcanvas.scss `.offcanvas-{direction}` modifier classes */ direction?: 'start' | 'end' | 'top' | 'bottom' | undefined /** responsive variant offcanvas-{size} ($grid-breakpoints minus xs) — replaces the base .offcanvas class */ size?: 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | undefined show?: boolean class?: string /** defaults to "-1" when not provided */ tabindex?: string /** defaults to "dialog" when not provided */ role?: astroHTML.JSX.AriaRole /** remaining attributes (id, aria-*, data-bs-*, …) are forwarded to the element */ [key: string]: unknown } const { direction, size, show, class: className, tabindex, role, ...rest } = Astro.props --- <!-- BEGIN OFFCANVAS --> <div class:list={[size ? `offcanvas-${size}` : 'offcanvas', direction && `offcanvas-${direction}`, show && 'show', className]} tabindex={tabindex ?? '-1'} role={role ?? 'dialog'} {...rest}> <slot /> </div> <!-- END OFFCANVAS -->