fullScreenCover
Present content that covers the whole screen.
fullScreenCover(options) takes the same options as sheet, but the content covers the whole screen and can't be swiped away, so provide a close button inside it.
import { Button, Modifier, Text, useState, VStack } from "onescript/views"
function Onboarding() {
const [shown, setShown] = useState(true)
return (
<Text modifier={Modifier.fullScreenCover({
isPresented: shown,
onDismiss: () => setShown(false),
content: (
<VStack spacing={16}>
<Text>Welcome</Text>
<Button action={() => setShown(false)}>Get Started</Button>
</VStack>
),
})}>
Home
</Text>
)
}| Option | Type | Description |
|---|---|---|
isPresented | boolean | Whether the cover is shown. |
onDismiss | () => void | Called when the system dismisses the cover; set isPresented to false here. |
content | ViewChild | The presented content. |
How is this guide?
Last updated on