Sheet
Sheet, a React Native component for iOS, Android and web: A bottom sheet with drag to dismiss.
Usage
import { useState } from 'react';
import { Button } from './components/ui/button';
import { ListItem } from './components/ui/list';
import { Sheet } from './components/ui/sheet';
export default function Example() {
const [open, setOpen] = useState(false);
return (
<>
<Button variant="outline" onPress={() => setOpen(true)}>Change address</Button>
<Sheet open={open} onOpenChange={setOpen} title="Deliver to">
<ListItem title="Home" description="12th Main, near the metro" onPress={() => setOpen(false)} />
<ListItem title="Work" description="4th Cross, second floor" onPress={() => setOpen(false)} />
</Sheet>
</>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | ||
defaultOpen | boolean | false | |
onOpenChange | (open: boolean) => void | ||
title | string | ||
description | string | ||
children | ReactNode | ||
footer | ReactNode | ||
dismissible | boolean | true | When false, nothing but your own controls can close it. |
closeLabel | string | 'Close' | |
style | StyleProp<ViewStyle> | ||
testID | string | ||
native | boolean | Renders the system sheet when `@leoanimesh/ferrule-native` is available. Only with `nativeActions`, because a system sheet cannot hold React children; without them the Ferrule sheet is used. | |
nativeActions | { label: string; role?: 'cancel' | 'destructive'; onPress?: () => void }[] |