I am am building a teams app, I want to set the teams theme using fluent theme, what are the exact values for theme in theme provider, Can i use fluentui/Northstar and fluentui/react together?
Asked
Active
Viewed 1,270 times
0
-
Refer: https://fluentsite.z22.web.core.windows.net/0.56.0/quick-start – Subba Reddi Tummuru Jun 27 '21 at 11:56
2 Answers
0
Please take a look at Designing your Microsoft Teams app with UI templates. The templates are a collection of Fluent UI-based components that work across common Teams use cases, giving you more time to figure out the best experience for your users.

Wajeed Shaikh
- 3,078
- 1
- 23
- 30
-
I am currently using fluent/react detailslist, I have wrapped it in teamstheme provider from fluent/Northstar. When I change the teams theme the theme is not getting applied to the details list components from. Fluent react, when all the other components from fluent Northstar are working fine – Umamaheshwari G Sep 25 '21 at 20:08
-
How to handle teams theme ( default, dark, contrast) modes for fluent react based components – Umamaheshwari G Sep 25 '21 at 20:10
0
You can use package '@fluentui/react-northstar' for handling teams theme.
Use it something like below: import { Provider, teamsTheme, teamsDarkTheme, teamsHighContrastTheme } from '@fluentui/react-northstar'
public setThemeComponent = () => {
const rtl = i18n.dir() === "rtl";
if (this.state.theme === "dark") {
return (
<Provider theme={teamsDarkTheme} rtl={rtl}>
<div className="darkContainer">
{this.getAppDom()}
</div>
</Provider>
);
}
else if (this.state.theme === "contrast") {
return (
<Provider theme={teamsHighContrastTheme} rtl={rtl}>
<div className="highContrastContainer">
{this.getAppDom()}
</div>
</Provider>
);
} else {
return (
<Provider theme={teamsTheme} rtl={rtl}>
<div className="defaultContainer">
{this.getAppDom()}
</div>
</Provider>
);
}
}
Also you can refer below sample apps for it: https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/blob/master/Source/CompanyCommunicator/ClientApp/src/App.tsx

Dharman
- 30,962
- 25
- 85
- 135

ChetanSharma-msft
- 702
- 1
- 3
- 6