A react-native component library that implements the Fluent Design System.
Перейти к файлу
dependabot[bot] 74330675f2
Bump tslib from 2.6.3 to 2.7.0 (#3740)
Bumps [tslib](https://github.com/Microsoft/tslib) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/Microsoft/tslib/releases)
- [Commits](https://github.com/Microsoft/tslib/compare/v2.6.3...v2.7.0)

---
updated-dependencies:
- dependency-name: tslib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-19 16:18:49 -07:00
.ado use latest MacOS image available for Android PR (#3704) 2024-08-09 10:31:15 -07:00
.github Update CodeQL to v3 (#3463) 2024-03-01 15:39:19 -08:00
.idea Android tokens integration - set1 (#2159) 2022-09-30 13:15:27 +05:30
.vscode edit port again (#3309) 2023-12-16 00:03:38 +00:00
.yarn chore: Upgrade to Yarn 4 (#3169) 2024-04-18 21:03:04 +00:00
apps applying package updates 2024-09-09 16:52:21 +00:00
assets Update Fluent UI Tester instructions for win32 (#3330) 2024-01-02 14:36:58 -05:00
docs Delete Tabs and Experimental Tabs (#3356) 2024-01-16 16:56:21 -08:00
packages applying package updates 2024-09-09 16:52:21 +00:00
scripts Ensure build output has the generated view configs (#3572) 2024-04-15 20:44:59 +00:00
tester_deps Bump micromatch from 4.0.5 to 4.0.8 in /tester_deps (#3734) 2024-09-09 16:51:04 +00:00
.dockerignore Initial scaffolding (#1) 2019-08-02 09:28:49 -07:00
.eslintignore jscodeshift transforms for migrating Button from v0 to v1 (#1663) 2022-09-22 11:32:17 -07:00
.eslintrc.json [Proposal] Order imports using the eslint import plugin (#2632) 2023-02-24 11:59:20 -08:00
.gitattributes Add a git attributes file for line ending settings (#180) 2020-04-24 11:38:36 -07:00
.gitignore fix(ci): Refactor Apple jobs (#3631) 2024-05-22 14:30:06 -07:00
.node-version Update to RN 0.73 (#3543) 2024-04-11 10:32:42 -07:00
.npmignore Update appium and node version (#2745) 2023-04-06 18:50:11 -04:00
.prettierignore Add cli to run transforms using the codemods package (#2189) 2023-01-03 17:39:23 -08:00
.yarnrc.yml chore: Upgrade to Yarn 4 (#3169) 2024-04-18 21:03:04 +00:00
CODE_OF_CONDUCT.md Add a git attributes file for line ending settings (#180) 2020-04-24 11:38:36 -07:00
CONTRIBUTING.md Use codegenNativeComponent so JS View configs can be generated for all native components (#3533) 2024-03-29 10:36:02 -07:00
LICENSE Add a git attributes file for line ending settings (#180) 2020-04-24 11:38:36 -07:00
PRINCIPLES.MD Create PRINCIPLES.MD (#696) 2021-05-21 16:47:39 -07:00
README.md Update example on README (#3487) 2024-03-12 18:34:36 +00:00
SECURITY.md Create SECURITY.md 2022-02-04 11:32:43 -08:00
beachball.config.js Have postBump also regenerate lockfile (#3031) 2023-08-14 14:45:27 -07:00
lage.config.js Don't bundle in JS PR (#2792) 2023-04-22 23:18:40 -05:00
package.json Axios bump (#3716) 2024-08-19 20:01:57 +00:00
prettier.config.js Integrate dependency checker into CI and fix dependency errors (#392) 2020-08-17 14:54:38 -07:00
tsconfig.json Remove references to uifabricshared (#1342) 2022-01-13 18:29:21 -06:00
yarn.lock Bump tslib from 2.6.3 to 2.7.0 (#3740) 2024-09-19 16:18:49 -07:00

README.md

FluentUI React Native

npm version Build Status Build Status

FluentUI React Native is a javascript component library that provides developers with controls that are part of the Fluent Design System. These controls are built on React Native and fully customizable.

FluentUI React Native is still in the alpha stages of development for both the components and the repo. We encourage anyone who is interested in getting an early glimpse of our plans to download and use our components, but please note that you may hit bumps along the way. Please leave us feedback or file issues if you run into bumps, and we will continue to improve the quality of the repo.

Development status on each platform:

Windows macOS iOS Android
Alpha (in progress) Alpha (in progress) Alpha (in progress) Alpha (in progress)

Getting Started

If you have an existing React Native project, it's easy to begin using FluentUI React Native. If you need to setup a new React Native project, please see the React Native Windows Getting Started documentation.

Prerequisites

Create New React Native project (if needed)

  1. Follow the instructions on the React Native Windows Getting Started documentation to create a React Native project.

  2. Navigate to the root folder of your project, and use npm to install the package:

 npm i @fluentui/react-native
  1. After successful installation, you can test the package by importing components at the top of your app's entry file, e.g. App.js:
import { Checkbox } from '@fluentui/react-native';
  1. After importing the @fluentui/react-native package, you can use components such as Text and Checkbox in your JSX.
// In App.js in a new project
import React from 'react';
import { View, Text } from 'react-native';
import { CheckboxV1 as Checkbox } from '@fluentui/react-native';
function HelloWorldApp() {
  return (
    <View
      style={{
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
      }}
    >
      <Text>Hello, world!</Text>
      <Checkbox label="Hello World Checkbox" />
    </View>
  );
}
export default HelloWorldApp;

If you run into an error that says pragma and pragmaFrag cannot be set when runtime is automatic, you can try switching to classic runtime.

Documentation

Components and Controls

Our component documentation can be found in SPEC.md files for each component. The current list can be found in our Wiki's sidebar. They will be uploaded to a website at a future time.

Expanding Component documentation

Our SPEC.md files should reflect the current state of controls that have established the v1 set of properties on any one platform.

Since the FluentUI React Native controls are cross-platform, but represented by a single page, it's important to distinguish platform differences and limitations. Examples include:

  • If the component is not available on all supported platforms.
  • If the component has properties not available on all supported platforms.
  • If the component has limited support for a given property on any supported platforms.
  • If the component has distinguishable behavior on a supported platform that must be minded while used.

Theming framework

Documentation for Theming can be found in our docs file, or for more in depth documentation, along side the implementation.

Developing in the repo

Yarn + Lage

This repo is set up as a monorepo using Yarn workspaces. To install yarn, please follow instructions in the Yarn documentation.

For running tasks the repo has switched to using Lage for task running. The primary tasks that can be executed at the root are:

  • yarn build - does the typescript build for all packages in the repository
  • yarn test - will build, lint, and run any applicable tests on all packages in the repo
  • yarn bundle - will bundle all packages in the repo
  • yarn buildci - will build, lint, run tests, and bundle everything in the repo

Note that Lage uses caching to avoid redundant steps and has very minimal output. To avoid caching add --no-cache as a command line argument. Similarly adding --verbose will give more detailed output.

Setup your development environment

To start developing in the repository you can:

  1. git clone https://github.com/microsoft/fluentui-react-native.git
  2. cd fluentui-react-native
  3. yarn
  4. yarn build

After a successful yarn build, you can explore FluentUI Tester, our demo application to play with each of the controls. To run FluentUI Tester, please follow instructions in the FluentUI Tester readme.

Note: If your repo is located on either your Desktop or Documents folder, you may encounter the error: "Watchman error... Operation not permitted". Clone it in a different directory to avoid Watchman permission issues.

Prettier

This repo is set up to run Prettier. To run Prettier in fix mode on the repo, run yarn prettier-fix at the root of the Repo.

If you are using VSCode as your editor, you can configure it to run Prettier on save. Prettier is a recommended extension for the repo. You can configure it to run by:

  1. Installing the Prettier extension for VSCode
  2. Going to Settings > Text Editor > Formatting > Check Format On Save

Contributing

Please visit our contribution guide for more information on contributing to this repo.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.