The Sheet
component provides a versatile, draggable, and customizable interface for displaying secondary content or interactive elements. It supports smooth transitions, snap points, and flexible positioning for a modern user experience.
Here is an example of the Sheet
component in action:
<sheet class="bottom">
<p>Content</p>
</sheet>
Key details for using and customizing the Sheet
component:
--edge-offset-x
and --edge-offset-y
: Controls the edge offset for the sheet; default is 0
.--padding-x
and --padding-y
: Manages internal padding within the sheet.--radius
: Defines the sheet's corner roundness.--bg
: Sets the sheet's background color.--transition
: Specifies the transition effect when the sheet enters or exits the viewport..left
, .right
, .top
, or .bottom
.fixed
. Ensure any custom sheet element is similarly positioned..draggable-area
class to specify a drag handle; otherwise, the entire sheet is draggable..draggable-area
automatically apply user-select: none
for enhanced usability..rounded-all
to round all corners..no-indicator
to hide the drag indicator.The Sheet
component provides the following configuration options:
selector
(string): Default is .sheet
. Targets elements to initialize as sheets.draggableAreaSelector
(string): Default is .draggable-area
. Specifies the area used for dragging.dragThreshold
(number): Default is 0.4
(40% of the sheet). Determines when the sheet closes after dragging.oppositeDirectionAllowed
(number): Default is 0
. Controls how far the sheet can be dragged in the opposite direction.snapElementSelector
(string): Default is .snap
. Identifies elements to serve as snap points.dragClose
(boolean): Default is true
. Enables closing the sheet by dragging.keyboardClose
(boolean): Default is true
. Enables closing the sheet using the ESC key.