Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates a simple counter layout using Fluent UI components and React for interactivity.
import React, { useState } from 'react';
import { DefaultButton, Stack, Text } from '@fluentui/react';
const Counter = () => {
const [count, setCount] = useState(0);
const [isDark, setIsDark] = useState(false);
return (
<Stack horizontalAlign='center' verticalAlign='center' styles={{ root: { minHeight: '100vh', background: isDark ? '#333' : '#f3f3f3', color: isDark ? '#fff' : '#000' } }}>
<Text variant='xLarge'>Counter: {count}</Text>
<Stack horizontal tokens={{ childrenGap: 10 }} styles={{ root: { marginTop: 20 } }}>
<DefaultButton text='+' onClick={() => setCount(count + 1)} />
<DefaultButton text='-' onClick={() => setCount(count - 1)} />
<DefaultButton text='Reset' onClick={() => setCount(0)} />
</Stack>
<DefaultButton text='Switch Theme' onClick={() => setIsDark(!isDark)} styles={{ root: { marginTop: 20 } }} />
</Stack>
);
};
export default Counter;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.