Sheet
General-purpose surface container with optional swipe-to-expand bottom-sheet gesture. Used as the base layer for Dialog, Picker, ColorPickerField and other overlay components.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
coloredRendu de l’aperçu en cours…
outlinedRendu de l’aperçu en cours…
elevatedStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-sheet> — 3 parts: root surface ①, drag handle (when swipeable) ②, and default slot content ③.- 1.origam-sheet
- Root element. Polymorphic (tag prop). Carries all BEM modifiers and CSS variable overrides from tokens.
- 2.origam-sheet__handle / .origam-sheet__handle-pill
- Drag handle rendered only when swipeable=true and side="bottom". Has role="button" and tabindex="0" for keyboard accessibility.
- 3#default slot
- Main content area. Rendered below the handle when swipeable.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- sideTDirectionBoth
- Edge the sheet is anchored to. Only 'bottom' activates the swipe gesture today. Other values reserve the prop for future side-sheet patterns.
- swipeablebooleanfalse
- Enables the mobile-style swipe-to-expand / swipe-to-dismiss gesture. Effective only when side='bottom'.
- snapPointsReadonlyArray<TSheetSnapPoint>closed/peek(120px)/half(50vh)/full(90vh)
- Discrete heights the sheet settles on after a drag. Each entry is { id, height } where height is a number (px) or CSS length string.
- defaultSnapTSheetSnapId'half'
- Initial snap id when the sheet mounts. One of 'closed', 'peek', 'half', 'full' or a custom id.
- openboolean
- v-model:open — false maps to the 'closed' snap, true restores the last non-closed snap.
- disabledbooleanfalse
- Disables the swipe gesture. The sheet stays at defaultSnap.
- persistentbooleanfalse
- Prevents swipe-dismiss below the 'closed' snap. A fast downward flick snaps to the next non-zero point instead.
- handleLabelstring
- tagstring'div'
- Root HTML element.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- color
- Text/foreground color of the sheet surface.
- bgColor
- Background color override for the sheet surface.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies border tokens to the sheet surface.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- Border-radius applied to the sheet. When swipeable=true the sheet token defaults to 2xl on the top corners.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- Box-shadow elevation token applied to the surface.
- heightnumber | string
- Height override. Used by the swipe composable to set the live snap height via --origam-sheet---swipe-height.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Width override.
- locationTAnchor
- positionTPosition
- topnumber | string
- bottomnumber | string
- leftnumber | string
- rightnumber | string
- activeboolean | IStateEffectConfigfalse
- Forces the active visual state.
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Main sheet content. Rendered after the drag handle (when swipeable=true).
API
Emits
Événements émis par ce composant.
- @update:snapTSheetSnapId
- Emitted whenever the gesture or snapTo() settles on a new snap-point id ('closed', 'peek', 'half', 'full' or custom).
- @update:openboolean
- Emitted on the closed/non-closed boundary to keep v-model:open consistent when the user dismisses via swipe.
- @update:activeany
- @update:hoverboolean
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to child components.
- (id: TSheetSnapId) => void
- Imperatively snap the sheet to a given snap-point id.
- Ref<TSheetSnapId>
- Reactive current snap-point id.
- Ref<boolean>
- True while the user is dragging the sheet handle.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet. Called automatically on mount.
- () => void
- Removes the injected style sheet. Called automatically on unmount.
- Ref<boolean>
- True once the style sheet has been injected.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Surface background color.
- Surface foreground color.
- Box-shadow elevation. Overridden by elevation prop.
- Live height driven by the swipe gesture composable. Updated on every pointer-move frame during a drag.
- Width of the drag handle pill.
- Height of the drag handle pill.
- Background color of the drag handle pill.
- Border-radius applied to top corners when swipeable=true.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Interactions clavier
| Touche | Action |
|---|---|
| Tab (handle) | Focuses the drag handle button when swipeable=true. |
| Enter / Space (handle) | Cycles through snap points when the handle is focused. |
Notes
- The drag handle has role="button", tabindex="0" and aria-label="Drag handle" so keyboard users can navigate snap points without touch.
- Under prefers-reduced-motion, the height transition is disabled. Height still changes imperatively but without animation.
- OrigamSheet is a surface-only primitive. Overlay focus-trap and aria-modal semantics are managed by the Dialog or Drawer wrapper using this component.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__surface---default)
- Surface background color.
- colorvar(--origam-color__text---primary)
- Surface text color.
- dimension32px
- Handle pill width.
- dimension4px
- Handle pill height.
- colorvar(--origam-color__border---subtle)
- Handle pill color.
- dimensionvar(--origam-radius---2xl)
- Top-corner border-radius in swipeable mode.
- dimension120px
- Default peek snap-point height.
- dimension50vh
- Default half-expanded snap-point height.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic surface
Bottom sheet (swipeable)
Custom snap points