Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Bottom Sheet

The bottom sheet is a slides from the bottom of the screen

banner-Bottom Sheet
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Usage

The Sheet is a container that slides from the bottom of the screen. A Sheet can contain anything. It can be used to display a list of items, show more details about an item, or even display a form.

Bottom Sheet Legion React Native
import { Button, Sheet, Text } from "@legion-crossplatform/ui"
import { useState } from "react"
import { ChevronDown, ChevronUp } from '@tamagui/lucide-icons'
export default function SheetDemo() {
const [open, setOpen] = useState(false)
const [position, setPosition] = useState(0)
return (

Anatomy

Bottom Sheet Legion React Native
import { Sheet } from '@legion-crossplatform/ui'
export default () => (
<Sheet>
<Sheet.Overlay />
<Sheet.Handle />
<Sheet.Frame>{/* ...inner contents */}</Sheet.Frame>
</Sheet>
)

Attributes

Attribute NameTypeDescription
animationConfigAnimated.SpringAnimationConfigDefault: true. Customize the spring used, passed to react-native’s Animated.spring()
defaultOpenbooleanUncontrolled open state on mount
defaultPositionnumberUncontrolled default position on mount
disableDragbooleanDisables all touch events to drag the sheet
dismissOnOverlayPressbooleanDefault: true. Controls tapping on the overlay to close
dismissOnSnapToBottombooleanAdds a snap point to the end of your snap points set to “0”, that when snapped to will set open to false (uncontrolled) and call onOpenChange with false (controlled)
forceRemoveScrollEnabledbooleanDefault: false. By default, sheet uses react-remove-scroll to prevent anything outside the sheet scrolling. This can cause some issues so you can override the behavior with this prop (either true or false)
modalbooleanRenders sheet into the root of your app instead of inline
moveOnKeyboardChangebooleanDefault: false. Native only flag that will amke the sheet move up when the mobile keyboard opens so the focused input remains visible
onOpenChange(open: boolean) => voidCalled on change open, controlled or uncontrolled
onPositionChange(position: number) => voidCalled on change position, controlled or uncontrolled
openbooleanSet to use as controlled component
portalPropsObjectYStack property that can be passed to the Portal that sheet uses when in modal mode
positionnumberControlled position, set to an index of snapPoints
snapPoints(number \| string)[] | undefinedDefault: [80]. Array of values representing different sizes for the sheet to snap to. Not used in ‘fit’ mode. See docs above for usage information
snapPointsModepercent | constant | fit | mixedDefault: percent. Alters the behavior of the snapPoints property. See docs above for usage information
unmountChildrenWhenHiddenbooleanDefault: false. Flag to enable unmounting the children after the exit animation has completed