Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates opening and closing a modal dialog using Fluent UI Dialog.
import React, { useState } from 'react';
import { Dialog, DialogType, DialogFooter, DefaultButton, PrimaryButton, Stack } from '@fluentui/react';
const DialogExample = () => {
const [hideDialog, setHideDialog] = useState(true);
return (
<Stack horizontalAlign='center' verticalAlign='center' verticalFill styles={{ root: { minHeight: '100vh' } }}>
<DefaultButton text='Open Dialog' onClick={() => setHideDialog(false)} />
<Dialog hidden={hideDialog} onDismiss={() => setHideDialog(true)} dialogContentProps={{ type: DialogType.normal, title: 'Fluent UI Dialog', subText: 'This is a dialog example.' }} modalProps={{ isBlocking: false }}>
<DialogFooter>
<PrimaryButton text='Close' onClick={() => setHideDialog(true)} />
</DialogFooter>
</Dialog>
</Stack>
);
};
export default DialogExample;Fluent UI is a React-based front-end framework developed by Microsoft that provides a set of customizable, accessible, and enterprise-ready UI components for building modern web applications.
Origin & Creator
Created by Microsoft (initially as Office UI Fabric) in 2016 to standardize UI for Office and enterprise apps.
Industrial Note
Fluent UI is widely used in Microsoft ecosystems, Office 365 integrations, and enterprise web applications requiring consistency with Microsoft design guidelines.