Skip to main content

Dialog

Classic variant

Example banner

Default variant

Example banner

Implementation codeโ€‹

Wrap your app.js code with PortalProvider component to use dialog.

import { PortalProvider, NativeProvider } from '@nexara/nativeflow';
import Component from './path';

const App = () => {
return (
<NativeProvider>
<PortalProvider>
<Component/>
</PortalProvider>
</NativeProvider>
)
}
export default App;
import { Dialog, DialogHead, DialogBody, DialogDescription, DialogFoot, Button } from '@nexara/nativeflow';

const Component = () => {

const dialogRef = useRef<DialogRefProps>(null);

return (
<Button
title='Cancel'
onPress={()=> dialogRef.current.open()}
/>
<Dialog ref={dialogRef} size='lg' variant='classic' onClose={() => {}}>
<DialogHead title='Invite your team' />
<DialogBody>
<DialogDescription>
Elevate user interactions with our versatile modals. Seamlessly integrate notifications, forms, and media displays. Make an impact effortlessly.
</DialogDescription>
</DialogBody>
<DialogFoot>
<Button
variant='outlined'
title='Cancel'
titleColor='#000'
paddingV={12}
paddingH={14}
/>
<Button
variant='contained'
title='Explore'
bg='#000'
titleColor='#fff'
paddingV={12}
paddingH={14}
/>
</DialogFoot>
</Dialog>
);
}
export default Component;
import { Dialog, DialogHead, DialogBody, DialogDescription, DialogFoot, Button } from '@nexara/nativeflow';

const Component = () => {

const dialogRef = useRef<DialogRefProps>(null);

return (
<Button
title='Cancel'
onPress={()=> dialogRef.current.open()}
/>
<Dialog ref={dialogRef} onClose={() => {}} >
<DialogHead title='Contact US' />
<DialogBody >
<UserInput
cursorColor='#000'
textColor='#000'
label='Password'
variant='outlined'
/>
<UserInput
cursorColor='#000'
textColor='#000'
label='Password'
variant='outlined'
/>
</DialogBody>
<DialogFoot>
<Button
variant='outlined'
title='Cancel'
titleColor='#000'
paddingV={12}
paddingH={14}
/>
<Button
variant='contained'
title='Save'
bg='#000'
titleColor='#fff'
paddingV={10}
paddingH={13}
/>
</DialogFoot>
</Dialog>
);
}
export default Component;

Propsโ€‹

PropTypeDefaultDescription
variantdefault, classicdefaultIt sets the variant of the dialog
sizexs, sm, md, lg, fulllgIt sets the horizontal size of the dialog
fullScreenbooleanfalseDialog covers full screen when fullScreen is set to true
backdropColorstring'rgba(0, 0, 0, 0.5)'It sets the backdrop color of the dialog
onClosefunctionIt fires when the user clicks on the backdrop or tries to close the dialog.
containerStyleViewStyleHelps to change the styles of the dialog container
refrefUsed to programmatically control the dialog
MethodDescription
open()Opens the dialog programmatically
close()Closes the dialog programmatically
PropTypeDefaultDescription
titlestringIt sets the title of the dialog
textVarianth1,h2,h3,h4,h5,h6,h7h4Determines the text variant applied to the title
fsnumberSets the font size of the title
textStyleTextStyleHelps to change the styles of the dialog Head title
containerStyleViewStyleHelps to change the styles of the dialog Head container
PropTypeDefaultDescription
scrollEnablebooleantrueEnables scrolling when content overflows from the parent
containerStyleViewStyleHelps to change the styles of the Dialog Body container
PropTypeDefaultDescription
fsnumberSets the font size of the description text
textVarianth1,h2,h3,h4,h5,h6,h7h5Determines the text variant applied to the description
containerStyleViewStyleHelps to change the styles of the dialog description container
textStyleTextStyleHelps to change the styles of the dialog description text
PropTypeDefaultDescription
containerStyleViewStyleHelps to change the styles of the dialog foot container