Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-uwp

myxvisual231MIT1.3.4TypeScript support: included

UWP Design & Fluent Design UiKit by React

uwp, microsoft-uwp, fluent, microsoft-fluent, uwp-design, fluent-design, react, typescript, javascript, react-components, windows-uwp

readme

img

react-uwp

cdnjs npm package Build Status

PeerDependencies Dependencies DevDependencies

React Components that Implement Microsoft's UWP Design & Fluent Design System.

Online Documentation

img Visit react-uwp.com online to review the API, see the components in action with live. Or build the documentation to locally.

Installation

React-UWP is available as an npm package.

Use NPM to get React-UWP components and core styling. All you need is node.js and gulp.

npm install --save react-uwp

Usage

React-UWP components require a theme to be provided. The quickest way to get up and running is by using the Theme to inject the theme into your application context.then, you can use any of the components as demonstrated in documentation.

If you coding by Typescript, add ReactUWP namespace to tsconfig.json.

{
  "compilerOptions": {
    "typeRoots": [
      "./node_modules/@types"
    ],
    "filesGlob": [
      "**/*.ts",
      "**/*.tsx"
    ],
    "files": [
      "node_modules/react-uwp/index.d.ts" // add to here.
    ]
  }
}

./App.js

import * as React from "react";
import * as ReactDOM from "react-dom";
import { Theme as UWPThemeProvider, getTheme } from "react-uwp/Theme";
import MyComponent from "./MyComponent";

export class App extends React.Component {
  render() {
    return (
      <UWPThemeProvider
        theme={getTheme({
          themeName: "dark", // set custom theme
          accent: "#0078D7", // set accent color
          useFluentDesign: true, // sure you want use new fluent design.
          desktopBackgroundImage: "http://127.0.0.1:8092/staticimages/jennifer-bailey-10753.jpg" // set global desktop background image
        })}
      >
        <MyComponent />
      </UWPThemeProvider>
    )
  }
}

ReactDOM.render(
  <App />,
  document.getElementById("app")
);

./MyComponent.js

import * as React from "react";
import Button from "react-uwp/Button";

export default class MyComponent extends React.Component<void, void> {
  render() {
    return (
      <Button tooltip="Mini Tooltip" />
    )
  }
}

Notice: that in the above example, we used:

import Button from "react-uwp/Button";

instead of

import { Button } from "react-uwp";

This will make your build process faster and your build output smaller.

For a complete mapping of React-UWP components to import, see /src/index.ts inside the React-UWP npm package root directory.

Custom Theme

We have implemented a default theme to render all React-UWP components. Styling components to your liking is simple and hassle-free. This can be achieved in the following two ways:

  • With the theme, you can use a custom theme to style components.
  • With the inline style, you can override individual component styles via the style property.

    Four Theme Style (Fluent Design & UWP Design)

    img

changelog

1.2.3 (2019-01-23)

1.2.2 (2019-01-23)

Bug Fixes

  • Fixed navigator.userAgent empty error and Close #60 (e120cbb)

Features

  • Add ContentDialog support empty button (50aaf4f)
  • Update Menu support deep child (27319ec)
  • Update Separator row mode style (5660399)

1.2.1 (2018-08-08)

Bug Fixes

  • Fixed Tab titles rendering as all Closes #57 (d2d241b)

1.2.0 (2018-07-27)

Bug Fixes

  • Fixed prfixAll types error (0c720bf)
  • Fixed render tab title bug (7745cf1)
  • Fixed theme types error (aa9e494)

1.1.9 (2018-05-22)

Bug Fixes

  • Fixed canvas color wheel render bug and Close #46 (2d1f616)
  • Fixed IS_NODE_ENV support detect electron environment and close #47 (f3faeda)
  • Fixed Toast doesn't show bug (6db882a)
  • Fixed wrong custom theme and inline style links and Close #43 (46049d8)

Features

  • Add Dynamic TypeScript DocGen Parser (818f23a)
  • Add theme.prepareStyles support typescript generics (a52f038)
  • Add theme.styleManager support typescript generics (a5053ee)

1.1.8 (2017-11-27)

Bug Fixes

  • Fixed CommandBar not support custom background (b51b0e7), closes #29

1.1.7 (2017-11-17)

Bug Fixes

  • Add generateAcrylicTexture support DataURL and edge (a875812), closes #23
  • Fixed the wrong LICENSE title (ca592ec), closes #26

Features

  • AddBlurEvent support include elment config (4f428f8)
  • Dialog blur event callback suopport clickIncludeElm (695ab87)
  • Update ColorPicker support classes style (74f5a1a)

1.1.6 (2017-09-26)

Features

  • Add scrollBar style selector to theme (20a4c7b), closes #21
  • Use blob url instead image data url (f83bc5e), closes #20

1.1.5 (2017-09-13)

Bug Fixes

  • Fixed package.json repeated reference dependency (e54b162)
  • Fixed same name export in the compiled files (e6f6a36)

Features

  • Update Dialog content supoort custom animation (1640b0a)
  • Update Dialog support custom animation (fbdfae2)

1.1.4 (2017-08-29)

Features

  • Add SplitViewCommand support controlled show label text (4ef9ff7), closes #17
  • Add TransformCard component (07642b5)

1.1.3 (2017-08-16)

Bug Fixes

  • Fall back react-transition-group version (a34e46c)
  • Fixed DropDownMenu onChangeValue callback error (8b953aa)
  • Fixed initWidth not working in NavigationView (8189635), closes #17

1.1.2 (2017-08-10)

Bug Fixes

  • Disabled Navigation controlled event (7212886)
  • Fixed ListView items missing key props (c4109fa)
  • Fixed MediaPlayer support react-player v0.20.0 (131d497)
  • Fixed ScrollReveal not working at theme after update (12d6c86)
  • Fixed styleManager create element in ssr bug (44cc7ca), closes #16
  • react-uwp not export LinkState (d38629c)

Features

  • Add Dialog component to source and docs (e9bda35), closes #11
  • Add RenderToBody support ssr (7f1d563)
  • Fixed RenderToBody wrong attribute name (e4abeb0)
  • Update RenderToBody support className (b97ba6b)

1.1.1 (2017-08-08)

Features

  • Add AppBarButton support css-in-js (f2b9126)
  • Add AutoSuggestBox and Icon support css-in-js (3ca0380)
  • Add AutoSuggestBox support css-in-js (44a33fb)
  • Add Button support css-in-js (b81871e)
  • Add CalendarView support css-in-js (e30abf7)
  • Add CheckBox support css-in-js (f9efffb)
  • Add ColorPicker support css-in-js (038ae15)
  • Add CommandBar support css-in-js (30e5f1e)
  • Add components support css-in-js (0fdece2)
  • Add ContentDialog support css-in-js and custom padding (ddd7b6b), closes #11
  • Add DatePicker support css-in-js (2a0f2b3)
  • Add DropDownMenu support css-in-js (5f1795d)
  • Add ElementState support disabled style (3140e01)
  • Add FloatNav support css-in-js (f1fb001)
  • Add FlyoutContent support css-in-js (012d46d)
  • Add Link support css-in-js (83e579e)
  • Add MarkdownRender support css-in-js (6335111)
  • Add MediaPlayer support css-in-js (22780b5)
  • Add Menu support css-in-js (aa05440)
  • Add ProgressBar support css-in-js (d58dc01)
  • Add ProgressRing support css-in-js (1a30b34)
  • Add PseudoClassesComponent (61f9f48)
  • Add RadioButton support cs-in-js (494962d)
  • Add Separator support css-in-js (dff5794)
  • Add setStylesToManager function (e0330e3)
  • Add Slider support css-in-js (e535eb7)
  • Add SplitView support css-in-js (708760f)
  • Add SplitViewCommand support css-in-js (9119657)
  • Add spreadObject common function (88ed707)
  • Add StyleManager class (62bdb49)
  • Add StyleManager support empty style item (5eb5381)
  • Add StyleManager support multiple theme (867a3af)
  • Add styleManager to typings (5b9c51b)
  • Add Swipe and FlipView support css-in-js (94c9dbb)
  • Add Tabs support css-in-js and custom animate (a598741), closes #11
  • Add Toast support css-in-js (376c7d2)
  • Add Toggle support css-in-js (d501b60)
  • Add Tooltip support css-in-js (99dbadf)
  • Add TreeView support css-in-js (07ffc39)
  • Remove ScrollReveal for window scope (45c6c98)
  • StyleManager support inline-style transform to CSSText (40d3a45)
  • StyleManager supprot render CSS (70c0380)
  • Support inline-style and css-in-js options (e538f3a)
  • Support StyleManager setStyle methods (46e46f6)
  • Update Button css-in-js style (4a4d93c)
  • Update Button css-in-js style (74c15fb)
  • Update Button support inline-style (799fa2f)
  • Update css-in-js to components (a0a0cec)
  • Update Icon support hover active styles (cb4840a)
  • Update StyleManager support add CSSText (8149025)
  • Update StyleManager support cached result (7eac2df)
  • Update StyleManager support dynamic style (496ed42)
  • Update StyleManager working with Theme component (040c2a9)
  • API: Change theme.prepareStyles to theme.prefixStyle (1d11548)

1.1.0 (2017-07-02)

Bug Fixes

  • Fixed components wrong type (b5d02c8)
  • Fixed example codes have incorrect import (664b91d), closes #5
  • Fixed segmdl2 css import wrong fonts path (15b908b), closes #6
  • Fixed Swipe styles (21a880d)

Features

  • Add Slider support touch event (4ba820f)
  • Add Swipe support touch event (0b5579f)
  • API: Add Theme support more API (9d4bdec)
  • API: Add Theme support will update theme callback (2fa4878)
  • component: Add ColorPicker support touch event (af62e4b)
  • Transform segmdl2 fonts link to cdnjs (83864db)

Performance Improvements

  • Improve FlipView & Siwpe performance (7e462e7)

1.0.9 (2017-06-27)

Bug Fixes

  • Add All components support SSR (6da91c8)
  • Fixed missing index not export Toast component (3ee8964)
  • Fixed SSR common scrollToYEasing use window (65e8480)
  • component: Fixe RadioButton cursor style (31cc11a)
  • component: Fixed DropDownMenu event handler bug (53e0af4)
  • component: Fixed FlipView style bug (b2f3b98)

1.0.8 (2017-06-25)

Features

  • Add server side rendering support (4056eca), closes #3

1.0.7 (2017-06-24)

Bug Fixes

  • compoent: Fixed FlipView swipe forward bug (5ca2a0e)
  • component: Remove Slider padding style (390226c)

Features

1.0.6 (2017-06-23)

Bug Fixes

  • component: Fixed MediaPlayer setTimeout bug (75a094a)
  • Fixed FlipView setState run at the unMounted bug (647190c)
  • Fixed Swipe setTimeout function call bug (39ee3f5)

Features

  • component: Add more API to Toast component (6e09b6c)
  • component: Add new Toast component (2a3d5fe)

1.0.5 (2017-06-21)

Bug Fixes

  • Fixed MediaPlayer style (3df1f62)
  • component: Fixed RatingControl bugs. (cf36477), closes #2
  • component: Fixed TimePicker wrong scroll style (a6ffb6a)

Features

  • API: Remove RatingControl iconNode props (b76472d)
  • common: Add warning and blurEvent methods (4c7f317)
  • common: Update AddBlurEvent class and add blur envent for DropDownMenu (d53f4a5)
  • common: Update AddBlurEvent support keydown (582a7d3)
  • component: Add all components blur event (00333e0), closes #2

1.0.4 (2017-06-20)

Bug Fixes

  • Fixed index export compoents (ee8adef)
  • compoent: Fixed CheckBox unsure status w style (b0bd23e)
  • component: Fixed Tooltip background style (f89f628)
  • componet: Fixed MediaPlayer Tooltip background style (3909fb9)
  • Fixed package.json dependencies (51f48ae)
  • Fixed package.json devDependencies modules (589b1e4)

Features

  • Add MediaPlayer display mode (167e281)
  • Add Slider support vertical display mode (dcc0c20)

1.0.3 (2017-06-16)

Bug Fixes

  • component: Fixed MediaPlayer end played value (9019201)
  • component: Fixed MediaPlayerwrong style. (25494d1)
  • component: Fixed Theme sureNeedGenerateAcrylic method bug (ccb6291)
  • component: Fixed TreeView direction is right wrong style (c4ddd5d)
  • componet: Fixed MediaPlayer endpaly status bug (11ec789)

Features

  • components: Update Theme API (0267905)
  • docs: Add Acrylic docs page (695f5fc)
  • styleGuide: Add commit message standard (8b58710)

Performance Improvements

  • Add segoe-mdl2-assets fontface base style (183aa79)
  • component: Add cache acrylic textures for Theme component (4645b57)
  • component: Add generateAcrylicTextures only run on change iamge (4491774)