Skip to main content

Sliding Container

shadow

wje-sliding-container is used for panels that slide in from the side or switch to a mobile bottom sheet in responsive layouts. The component can stay a classic side panel on desktop and become a bottom sheet below a breakpoint, with a backdrop, custom height, and optional resizing.

Responsive bottom sheet

Enable mobile presentation with mobile-presentation="bottom-sheet" and set the viewport threshold with mobile-break-point. Add backdrop-dismiss when tapping the backdrop should close the sheet. For user-resizable height, add sheet-resizable and set sheet-height, sheet-min-height, and sheet-max-height.

By default, the sheet panel is scoped to the viewport. In bottom sheet mode, the backdrop is moved to document.body, dims the full viewport, and does not lock document scrolling. To constrain the panel to part of the application, use sheet-scope="container" or sheet-scope="parent"; the backdrop remains page-wide. With sheet-scope="container", sheet-boundary can point to the closest composed ancestor selector that should bound the sheet panel.

<wje-button dialog="reservation-panel">Open panel</wje-button>

<wje-sliding-container
trigger="reservation-panel"
variant="over"
direction="left"
max-width="320px"
max-height="85vh"
screen-break-point="2000"
mobile-presentation="bottom-sheet"
mobile-break-point="768"
sheet-resizable
sheet-height="55vh"
sheet-min-height="35vh"
sheet-max-height="92vh"
backdrop-dismiss
has-opacity
>
<div class="panel-content">
<h3>Reservation details</h3>
<p>Desktop opens a side panel, mobile opens a bottom sheet.</p>
</div>
</wje-sliding-container>

Tune the backdrop and layers with CSS variables such as --wje-sliding-container-backdrop-background, --wje-sliding-container-backdrop-opacity, --wje-sliding-container-z-index, and --wje-sliding-container-portal-backdrop-z-index. The panel uses the sliding-container part; the resize handle uses sheet-handle-area and sheet-handle.

When to use

Use wje-sliding-container when you need a contextual panel, filter, record detail, or side workspace that should behave as a bottom sheet on mobile.

When not to use

Do not use it to solve business logic or for stateful orchestration of components.

Accessibility

Name the panel with label or aria-label, preserve the logical order of focusable elements, and for modal usage verify that the user can close the panel from the keyboard and a visible control.

  • Define desktop/mobile breakpoints first and then fine-tune the details.
  • Prefer consistent spacing tokens over ad-hoc margin/padding values.
  • In bottom sheet mode, test background scrolling, backdrop dismiss, and height changes on a real mobile viewport.

Attributes and properties

addToHeight

PopisNastavuje rozmery alebo veľkosť pre voľbu add-to-height.
Atribútadd-to-height
Typstring
Predvolené0

animationDuration

PopisNastavuje textovú hodnotu uloženú vo voľbe animation-duration.
Atribútanimation-duration
Typstring
Predvolené500

animationEasing

PopisNastavuje textovú hodnotu uloženú vo voľbe animation-easing.
Atribútanimation-easing
Typstring
Predvolenélinear

backdropDismiss

PopisUrčuje, či je voľba backdrop-dismiss zapnutá a ovplyvňuje správanie komponentu.
Atribútbackdrop-dismiss
Typboolean
Predvolenéfalse

direction

PopisNastavuje textovú hodnotu uloženú vo voľbe direction.
Atribútdirection
Typstring
Predvolenéright

hasOpacity

PopisUrčuje, či je voľba has-opacity zapnutá a ovplyvňuje správanie komponentu.
Atribúthas-opacity
Typboolean
Predvolenéfalse

maxHeight

PopisNastavuje rozmery alebo veľkosť pre voľbu max-height.
Atribútmax-height
Typstring
Predvolenéauto

maxWidth

PopisNastavuje rozmery alebo veľkosť pre voľbu max-width.
Atribútmax-width
Typstring
Predvolenéauto

mobileBreakPoint

PopisNastavuje textovú hodnotu uloženú vo voľbe mobile-break-point.
Atribútmobile-break-point
Typstring
Predvolené768

mobilePresentation

PopisNastavuje textovú hodnotu uloženú vo voľbe mobile-presentation.
Atribútmobile-presentation
Typstring
Predvolené-

removeChildAfterClose

PopisUrčuje, či je voľba remove-child-after-close zapnutá a ovplyvňuje správanie komponentu.
Atribútremove-child-after-close
Typboolean|string
Predvolenéfalse

screenBreakPoint

PopisNastavuje textovú hodnotu uloženú vo voľbe screen-break-point.
Atribútscreen-break-point
Typstring
Predvolené-

sheetBoundary

PopisNastavuje textovú hodnotu uloženú vo voľbe sheet-boundary.
Atribútsheet-boundary
Typstring
Predvolené-

sheetHeight

PopisNastavuje rozmery alebo veľkosť pre voľbu sheet-height.
Atribútsheet-height
Typstring
Predvolené-

sheetMaxHeight

PopisNastavuje rozmery alebo veľkosť pre voľbu sheet-max-height.
Atribútsheet-max-height
Typstring
Predvolené-

sheetMinHeight

PopisNastavuje rozmery alebo veľkosť pre voľbu sheet-min-height.
Atribútsheet-min-height
Typstring
Predvolené-

sheetResizable

PopisUrčuje, či je voľba sheet-resizable zapnutá a ovplyvňuje správanie komponentu.
Atribútsheet-resizable
Typboolean
Predvolenéfalse

sheetScope

PopisNastavuje textovú hodnotu uloženú vo voľbe sheet-scope.
Atribútsheet-scope
Typstring
Predvolenéviewport

trigger

PopisNastavuje textovú hodnotu uloženú vo voľbe trigger.
Atribúttrigger
Typstring
Predvolenésliding-container

variant

PopisNastavuje ARIA metadáta, ktoré zlepšujú prístupnosť pre asistenčné technológie.
Atribútvariant
Typstring
Predvolenéin-place

Events

NázovPopis
wje-sliding-container:beforeOpenVyvolá sa pri otvorení komponentu.
wje-sliding-container:openVyvolá sa pri otvorení komponentu.
wje-sliding-container:beforeCloseVyvolá sa pri zatvorení komponentu.
wje-sliding-container:afterCloseVyvolá sa pri zatvorení komponentu.

Methods

isBottomSheet

PopisOverí, či je bottom sheet aktuálne pravda.
Signatúra() => boolean

addBackdropListeners

PopisPridá backdrop poslucháče do spravovanej kolekcie komponentu.
Signatúra(backdrop: HTMLElement) => void

removeBackdropListeners

PopisOdstráni backdrop poslucháče z aktuálneho stavu komponentu.
Signatúra(backdrop: HTMLElement) => void

isBackdropElement

PopisOverí, či je backdrop element aktuálne pravda.
Signatúra(element: EventTarget|null) => boolean

getBackdropElement

PopisVráti backdrop element z aktuálneho stavu komponentu.
Signatúra({ createPortal = false }: any, options: object) => HTMLElement|null

ensurePortalBackdrop

PopisSpustí metódu ensurePortalBackdrop na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra() => HTMLElement

removePortalBackdrop

PopisOdstráni portal backdrop z aktuálneho stavu komponentu.
Signatúra() => void

getPortalBackdropZIndex

PopisVráti portal backdrop zindex z aktuálneho stavu komponentu.
Signatúra() => string

getBackdropOpenOpacity

PopisVráti backdrop open opacity z aktuálneho stavu komponentu.
Signatúra() => string

syncPortalBackdropStyles

PopisSynchronizuje portal backdrop styles s externým alebo interným zdrojom stavu.
Signatúra() => void

htmlSheetHandle

PopisVytvorí HTML štruktúru pre html sheet handle.
Signatúra() => HTMLElement

getClosestComposedElement

PopisVráti closest composed element z aktuálneho stavu komponentu.
Signatúra(selector: string) => Element|null

getViewportFrame

PopisVráti viewport frame z aktuálneho stavu komponentu.
Signatúra() => {top: number, left: number, right: number, bottom: number, width: number, height: number}

getBottomSheetScopeElement

PopisVráti bottom sheet scope element z aktuálneho stavu komponentu.
Signatúra() => Element|null

getBottomSheetScopeFrame

PopisVráti bottom sheet scope frame z aktuálneho stavu komponentu.
Signatúra() => {top: number, left: number, right: number, bottom: number, width: number, height: number}

setBottomSheetLayerFrame

PopisNastaví bottom sheet layer frame a aplikuje súvisiace zmeny stavu.
Signatúra(element: HTMLElement|SlidingContainer, frame: object) => void

resetBottomSheetLayerFrame

PopisObnoví bottom sheet layer frame na počiatočné hodnoty.
Signatúra(element: HTMLElement|SlidingContainer) => void

setBottomSheetVariant

PopisNastaví bottom sheet variant a aplikuje súvisiace zmeny stavu.
Signatúra() => void

resetBottomSheetVariant

PopisObnoví bottom sheet variant na počiatočné hodnoty.
Signatúra() => void

setBottomSheetVisualState

PopisNastaví bottom sheet visual state a aplikuje súvisiace zmeny stavu.
Signatúra(isOpen: boolean) => void

getSheetMaxHeight

PopisVráti sheet max height z aktuálneho stavu komponentu.
Signatúra() => string

setSheetHeight

PopisNastaví sheet height a aplikuje súvisiace zmeny stavu.
Signatúra() => void

getSheetMinHeightInPixels

PopisVráti sheet min height in pixels z aktuálneho stavu komponentu.
Signatúra() => number

getSheetMaxHeightInPixels

PopisVráti sheet max height in pixels z aktuálneho stavu komponentu.
Signatúra() => number

getBottomSheetAvailableHeight

PopisVráti bottom sheet available height z aktuálneho stavu komponentu.
Signatúra() => number

resolveCssHeight

PopisSpustí metódu resolveCssHeight na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(value: string, fallback: number) => number

clamp

PopisSpustí metódu clamp na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(value: number, min: number, max: number) => number

isSheetHandleEvent

PopisOverí, či je sheet handle udalosť aktuálne pravda.
Signatúra(e: Event) => boolean

isEventInsideSheet

PopisOverí, či je udalosť inside sheet aktuálne pravda.
Signatúra(e: Event) => boolean

startSheetDrag

PopisSpustí metódu startSheetDrag na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(pointerId: number|string, startY: number) => void

updateSheetDrag

PopisAktualizuje sheet ťahanie podľa najnovších údajov komponentu.
Signatúra(clientY: number) => void

endSheetDrag

PopisSpustí metódu endSheetDrag na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra() => void

doAnimateBottomSheetTransition

PopisSpustí metódu doAnimateBottomSheetTransition na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(options: object) => Promise<void>

open

PopisOtvorí komponent a nastaví viditeľný stav.
Signatúra(e: Event) => Promise<void>

close

PopisZatvorí komponent a odstráni stav viditeľnosti.
Signatúra(e: Event) => Promise<void>

setBottomSheetClosedState

PopisNastaví bottom sheet closed state a aplikuje súvisiace zmeny stavu.
Signatúra() => void

toggle

PopisPrepne toggle medzi zapnutým a vypnutým stavom.
Signatúra(e: Event) => Promise<void>

CSS shadow parts

NázovPopis
backdropŠtýluje shadow časť backdrop.
sliding-containerŠtýluje shadow časť sliding-container.
close-buttonŠtýluje shadow časť close-button.
sheet-handle-areaŠtýluje shadow časť sheet-handle-area.
sheet-handleŠtýluje shadow časť sheet-handle.

CSS custom variables

NázovPopis
--wje-sliding-container-backgroundVlastná CSS premenná na štýlovanie komponentu (background).
--wje-sliding-container-z-indexVlastná CSS premenná na štýlovanie komponentu (z index).
--wje-sliding-container-bottom-sheet-z-indexVlastná CSS premenná na štýlovanie komponentu (bottom sheet z index).
--wje-sliding-container-bottom-sheet-backdrop-z-indexVlastná CSS premenná na štýlovanie komponentu (bottom sheet backdrop z index).
--wje-sliding-container-bottom-sheet-panel-z-indexVlastná CSS premenná na štýlovanie komponentu (bottom sheet panel z index).
--wje-sliding-container-portal-backdrop-z-indexVlastná CSS premenná na štýlovanie komponentu (portal backdrop z index).
--wje-sliding-container-backdrop-backgroundVlastná CSS premenná na štýlovanie komponentu (backdrop background).
--wje-sliding-container-backdrop-opacityVlastná CSS premenná, ktorá riadi úroveň priehľadnosti.
--wje-sliding-container-box-shadowVlastná CSS premenná, ktorá riadi tieň.
--wje-sliding-container-sheet-border-radiusVlastná CSS premenná, ktorá riadi zaoblenie rohov.
--wje-sliding-container-sheet-handle-area-heightVlastná CSS premenná, ktorá riadi sheet handle area height.
--wje-sliding-container-sheet-handle-widthVlastná CSS premenná, ktorá riadi sheet handle width.
--wje-sliding-container-sheet-handle-heightVlastná CSS premenná, ktorá riadi sheet handle height.
--wje-sliding-container-sheet-handle-backgroundVlastná CSS premenná na štýlovanie komponentu (sheet handle background).
--wje-sliding-container-sheet-handle-radiusVlastná CSS premenná, ktorá riadi zaoblenie rohov.

Slots

NázovPopis
defaultPredvolený slot pre hlavný obsah komponentu.