### Project Setup and Run Commands Source: https://github.com/microsoft/fluentui/blob/master/packages/react-docsite-components/src/demo/demo.md Instructions for cloning a project, installing dependencies, and starting the development server using either npm or yarn. ```shell git clone https://github.com/microsoft/create-react-app-uifabric.git my-app cd my-app # with npm (default) npm install npm start # with yarn (optional) yarn yarn start ``` -------------------------------- ### Download and Install Vite.js Example Source: https://github.com/microsoft/fluentui/blob/master/starter-templates/src/react-components-vite/README.md Use these commands to download the starter template and install its dependencies. ```bash npx degit microsoft/fluentui/starter-templates/src/react-components-vite cd react-components-vite npm install npm run dev ``` -------------------------------- ### Peer Dependencies Installation Example Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/dependency-versions.md Illustrates the command required for a consumer to manually install all dependencies if Fluent UI were to use peerDependencies, which is generally discouraged due to the burden on the customer. ```bash $ yarn add @fluentui/react-COMPONENT DEPENDENCY1 DEPENDENCY2 ... DEPENDENCY999 ``` -------------------------------- ### Start Storybook for @fluentui/react Source: https://github.com/microsoft/fluentui/blob/master/packages/react-examples/README.md Use this command to start Storybook for the @fluentui/react package. The same command structure applies to other packages with examples in this folder. ```bash yarn workspace @fluentui/react start ``` -------------------------------- ### Setup Test Environment Source: https://github.com/microsoft/fluentui/blob/master/scripts/projects-test/README.md Import and use functions to set up a test environment. Ensure necessary packages are installed. ```typescript /* @filename /scripts/project-test.setup.ts */ import { packProjectPackages, prepareTempDirs } from '@fluentui/scripts-projects-test'; // setupTest(); function setupTest() { // add your logic here } ``` -------------------------------- ### Install @fluentui/react-motion Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-motion/library/README.md Install the library using npm or yarn. ```bash npm install @fluentui/react-motion # or yarn add @fluentui/react-motion ``` -------------------------------- ### Install @fluentui/babel-preset-global-context Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/babel-preset-global-context/README.md Install the Babel preset as a development dependency. ```bash yarn add --dev @fluentui/babel-preset-global-context # or npm install --dev @fluentui/babel-preset-global-context ``` -------------------------------- ### Install @fluentui/react-portal-compat-context Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-portal-compat-context/README.md Install the package using yarn. ```sh yarn add @fluentui/react-portal-compat-context ``` -------------------------------- ### Individual Component File Example Source: https://github.com/microsoft/fluentui/blob/master/tools/storybook-llms-extractor/README.md Each component has its own detailed documentation file, including props and examples. ```markdown # Components/Button A button triggers an action or event. ## Props | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | `appearance` | `"primary" | "secondary"` | No | `"secondary"` | Button appearance | ## Examples ### Primary Button ```tsx ``` ``` -------------------------------- ### Install Motion Components Preview Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-motion-components-preview/library/README.md Install the @fluentui/react-motion-components-preview package using npm or yarn. ```bash npm install @fluentui/react-motion-components-preview # or yarn add @fluentui/react-motion-components-preview ``` -------------------------------- ### ESLint Configuration Example Source: https://github.com/microsoft/fluentui/blob/master/packages/eslint-plugin/README.md Example of how to extend ESLint configuration with Fluent UI plugins. ```json { "extends": ["plugin:@fluentui/"] } ``` ```json { "extends": ["plugin:@fluentui/eslint-plugin/"] } ``` -------------------------------- ### Install and Clean Dependencies Source: https://github.com/microsoft/fluentui/blob/master/docs/workflows/contributing.md Use these commands to set up your development environment by installing dependencies and cleaning build artifacts. ```bash yarn # Install dependencies yarn clean # Clean build artifacts ``` -------------------------------- ### Install @fluentui/react-portal-compat Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-portal-compat/README.md Install the package using yarn. ```sh yarn add @fluentui/react-portal-compat ``` -------------------------------- ### Run Custom Nx Console CLI Alternative Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/command-cheat-sheet.md Use `yarn start` as a custom CLI alternative to guide you through monorepo operations. ```shell yarn start # our custom nx-console CLI alternative to guide you through monorepo ``` -------------------------------- ### Install @fluentui/style-utilities Source: https://github.com/microsoft/fluentui/blob/master/packages/style-utilities/README.md Install this package as a dependency if your project does not use @fluentui/react. ```bash npm install --save @fluentui/style-utilities ``` -------------------------------- ### Basic Label Example in React Source: https://github.com/microsoft/fluentui/blob/master/packages/react-monaco-editor/src/transpiler/examples/function.txt Demonstrates how to render a basic Label component using Fluent UI React. Ensure Fluent UI libraries are installed and imported. ```javascript import * as React from 'react'; import { Label } from '@fluentui/react/lib/Label'; export const LabelBasicExample = () => { return (
); }; ``` -------------------------------- ### Basic Label Example Source: https://github.com/microsoft/fluentui/blob/master/packages/react-monaco-editor/src/transpiler/examples/functionTranspiled.txt A simple example showing how to render a basic Label component with text content. Ensure the Fluent UI React library is installed and imported. ```typescript import * as React from 'react'; import { Label } from '@fluentui/react/lib/Label'; export var LabelBasicExample = function () { return (React.createElement("div", null, React.createElement(Label, null, "I'm a Label"))); }; ``` -------------------------------- ### Install keyboard-key Source: https://github.com/microsoft/fluentui/blob/master/packages/keyboard-key/README.md Install the package using yarn or npm. ```bash yarn add keyboard-key # or npm install keyboard-key ``` -------------------------------- ### Install Dependencies Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/common-dev-snags.md Run this command to install or update project dependencies. ```bash yarn ``` -------------------------------- ### Install Addon Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-storybook-addon-export-to-sandbox/README.md Install the addon using yarn. ```sh yarn add @fluentui/react-storybook-addon-export-to-sandbox ``` -------------------------------- ### Install Dependencies and Link Packages Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/dev-workflow.md Run this command in the root of the repository to install all necessary dependencies and link packages. ```bash cd fluentui yarn ``` -------------------------------- ### Install Fluent UI Web Components with NPM Source: https://github.com/microsoft/fluentui/blob/master/packages/web-components/README.md Install the beta version of Fluent UI Web Components using NPM. ```sh npm i @fluentui/web-components@beta ``` -------------------------------- ### Install Fluent UI Web Components with Yarn Source: https://github.com/microsoft/fluentui/blob/master/packages/web-components/README.md Install the beta version of Fluent UI Web Components using Yarn. ```sh yarn add @fluentui/web-components@beta ``` -------------------------------- ### Install @fluentui/global-context Shim Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/babel-preset-global-context/README.md Install the shims for createContext that the Babel preset will use to replace original React.createContext calls. ```bash yarn add @fluentui/global-context # or npm install @fluentui/global-context ``` -------------------------------- ### Install ESLint Plugin Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/eslint-plugin-react-components/README.md Install the plugin using npm, yarn, or pnpm. ```bash npm install --save-dev @fluentui/eslint-plugin-react-components ``` ```bash yarn add --dev @fluentui/eslint-plugin-react-components ``` ```bash pnpm add --save-dev @fluentui/eslint-plugin-react-components ``` -------------------------------- ### Install Fluent UI Headless Components with npm Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9-headless/src/GettingStarted.mdx Install the Fluent UI Headless components preview package using npm. This package is tree-shakable. ```bash npm install @fluentui/react-headless-components-preview ``` -------------------------------- ### Install Fluent UI Web Components with pnpm Source: https://github.com/microsoft/fluentui/blob/master/packages/web-components/README.md Install the beta version of Fluent UI Web Components using pnpm. ```sh pnpm add @fluentui/web-components@beta ``` -------------------------------- ### Install @fluentui/react-charting Source: https://github.com/microsoft/fluentui/blob/master/packages/charts/react-charting/README.md Install the charting library using npm. This command adds the package to your project dependencies. ```bash npm install @fluentui/react-charting ``` -------------------------------- ### Install Fluent UI and Vite Dependencies Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9/src/Concepts/SSR/Remix.mdx Install the core Fluent UI packages and required Vite plugins for your project. ```bash # Install Fluent UI core packages npm i @fluentui/react-components @fluentui/react-icons # Install required Vite plugins npm i vite-plugin-cjs-interop @griffel/vite-plugin -D ``` -------------------------------- ### Install Fluent UI Headless Components with Yarn Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9-headless/src/GettingStarted.mdx Install the Fluent UI Headless components preview package using Yarn. This package is tree-shakable. ```bash yarn add @fluentui/react-headless-components-preview ``` -------------------------------- ### Install Fluent UI Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9/src/Concepts/QuickStart.mdx Install the Fluent UI React components library as a dependency in your project using yarn. ```sh yarn add @fluentui/react-components ``` -------------------------------- ### Install Fluent UI Headless Components with pnpm Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9-headless/src/GettingStarted.mdx Install the Fluent UI Headless components preview package using pnpm. This package is tree-shakable. ```bash pnpm add @fluentui/react-headless-components-preview ``` -------------------------------- ### Example Card Usage Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-card/library/README.md Demonstrates a complete example of a React Card component with a header, preview, and footer, including buttons for reply and share actions. ```jsx import { Share16Regular, ArrowReply16Regular } from '@fluentui/react-icons'; import { Button, Body1, Caption1 } from '@fluentui/react-components'; import { Card, CardHeader, CardPreview, CardFooter } from '@fluentui/react-components'; const App = () => ( <> } header={ Elvia Atkins mentioned you } description={5h ago ยท About us - Overview} /> } > Preview of a Word document ); ``` -------------------------------- ### Install Fluent UI Web Components and Tokens Source: https://github.com/microsoft/fluentui/blob/master/packages/web-components/src/_docs/developer/quick-start.mdx Install the Fluent UI web components and Fluent tokens packages as dependencies for your application. ```sh npm install @fluentui/web-components @fluentui/tokens ``` -------------------------------- ### Install React Text and Provider Separately Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-text/library/README.md Install only the @fluentui/react-text package and the @fluentui/react-provider package if you only need text components and the provider. ```sh npm install @fluentui/react-text npm install @fluentui/react-provider ``` -------------------------------- ### Install Webpack Utilities Source: https://github.com/microsoft/fluentui/blob/master/packages/webpack-utilities/README.md Install the Fluent UI React Webpack utilities as a development dependency using npm or yarn. ```bash npm i -D @fluentui/webpack-utilities ``` ```bash yarn add -D @fluentui/webpack-utilities ``` -------------------------------- ### Get Start Date of Week Source: https://github.com/microsoft/fluentui/blob/master/packages/date-time-utilities/etc/date-time-utilities.api.md Calculates the start date of the week for a given date, based on the specified first day of the week. ```typescript getStartDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date; ``` -------------------------------- ### Start Legacy Demo App for @fluentui/react Source: https://github.com/microsoft/fluentui/blob/master/packages/react-examples/README.md Initiate the legacy demo application for @fluentui/react. This command is also applicable to @fluentui/react-charting and @fluentui/react-experiments. ```bash yarn workspace @fluentui/react start:legacy ``` -------------------------------- ### Get Year Start Source: https://github.com/microsoft/fluentui/blob/master/packages/date-time-utilities/etc/date-time-utilities.api.md Calculates the first day of the year for a given date. ```typescript getYearStart(date: Date): Date; ``` -------------------------------- ### Build React Package Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/dev-workflow.md Example of building the 'react' package using the nx command. ```bash yarn nx run react:build ``` -------------------------------- ### Get Month Start Source: https://github.com/microsoft/fluentui/blob/master/packages/date-time-utilities/etc/date-time-utilities.api.md Calculates the first day of the month for a given date. ```typescript getMonthStart(date: Date): Date; ``` -------------------------------- ### Install Fluent UI v9 Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9/src/Concepts/Migration/FromV8/ComponentMapping.mdx Install the latest Fluent UI React v9 package using npm to begin your migration. ```bash npm install @fluentui/react-components ``` -------------------------------- ### Project Naming Conventions Example Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/shared/repo-organization.md Demonstrates how project names will mirror their folder structure to prevent naming conflicts. ```bash - `/react-components/apps/docsite` -> `react-components-docsite` - `/react-components/apps/ssr-tests` -> `react-components-ssr-tests` ``` -------------------------------- ### Exact Version Dependency Example Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/dependency-versions.md Illustrates how using an exact version for a dependency in one package can lead to a different version being installed by another package manager, potentially causing duplicate installations. ```json { "name": "@fluentui/react-COMPONENT", "dependencies": { "lodash": "4.17.20" } } ``` ```json { "name": "eslint", "dependencies": { "lodash": "^4.17.21" } } ``` -------------------------------- ### Prepare Initial Release Command Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/component-implementation-guide.md Use this command to prepare a component for an unstable preview release. Replace MYCOMPONENT with the actual package name. ```bash yarn nx generate prepare-initial-release --project @fluentui/react-MYCOMPONENT-preview --phase=preview ``` -------------------------------- ### Get Class Names for Tree Styles Source: https://github.com/microsoft/fluentui/blob/master/packages/charts/react-charting/src/components/TreeChart/TreeChart.md Initializes the getClassNames function for applying tree-specific styles. This is typically used in the component's setup. ```typescript const getClassNames = classNamesFunction(); ``` -------------------------------- ### Basic Griffel Conformance Setup Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-conformance-griffel/README.md Use this snippet to integrate Griffel-specific conformance tests into your component testing suite. Ensure `@fluentui/react-conformance` is installed to avoid type issues. ```typescript import { isConformant } from '@fluentui/react-conformance'; import griffelTests from '@fluentui/react-conformance-griffel'; isConformant({ Component, extraTests: griffelTests, }); ``` -------------------------------- ### Basic Cypress Component Test Example Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/e2e-testing-with-cypress.md Demonstrates a basic structure for a Cypress component test, including mounting a React component and interacting with elements. Use this as a starting point for writing your own tests. ```tsx import * as React from 'react'; import { mount } from '@cypress/react'; import { Sample } from './Sample'; describe('Sample', () => { it('opens the menu', () => { // Assume Sample contains a button "Open menu" which opens a menu mount(); // Wait for the component to render (.contains() will retry until a matching element is found) // and click the button cy.contains('Open menu').click(); // Verify that the menu opened (will retry until it succeeds or times out) cy.contains('Good option').should('exist'); }); }); ``` -------------------------------- ### Getting Started with React Context Selector Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-context-selector/README.md Demonstrates creating a context, providing values, and consuming specific parts of the context using `useContextSelector`. Context updates are propagated only when the selector function's result changes, using 'Object.is()' for comparison. ```tsx import * as React from 'react'; import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector'; interface CounterContextValue { count1: number; count2: number; incrementCount1: () => void; incrementCount2: () => void; } // ๐Ÿ’ก The same syntax as native React context API // https://reactjs.org/docs/context.html#reactcreatecontext const CounterContext = createContext({} as CounterContextValue); const CounterProvider = CounterContext.Provider; // not necessary but can be a good layer to mock for unit testing const useCounterContext = (selector: ContextSelector) => useContextSelector(CounterContext, selector); const Counter1 = () => { // ๐Ÿ’ก Context updates will be propagated only when result of a selector function will change // "Object.is()" is used for internal comparisons const count1 = useCounterContext(context => context.count1); const increment = useCounterContext(context => context.incrementCount1); return ; }; const Counter2 = () => { const count2 = useCounterContext(context => context.count2); const increment = useCounterContext(context => context.incrementCount2); return ; }; export default function App() { const [state, setState] = React.useState({ count1: 0, count2: 0 }); const incrementCount1 = React.useCallback(() => setState(s => ({ ...s, count1: s.count1 + 1 })), [setState]); const incrementCount2 = React.useCallback(() => setState(s => ({ ...s, count2: s.count2 + 1 })), [setState]); return (
); } ``` -------------------------------- ### BreadcrumbButton Example Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-breadcrumb/library/docs/Spec.md A simple example of a BreadcrumbButton with a link. ```jsx Item ``` -------------------------------- ### Install @fluentui/react-context-selector with NPM Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-context-selector/README.md Use this command to add the package to your project using npm. ```bash npm install --save @fluentui/react-context-selector ``` -------------------------------- ### Install storybook-llms-extractor Source: https://github.com/microsoft/fluentui/blob/master/tools/storybook-llms-extractor/README.md Install the package using npm or yarn. ```bash npm install @fluentui/storybook-llms-extractor # or yarn add @fluentui/storybook-llms-extractor ``` -------------------------------- ### Prepare Initial Release for Preview Source: https://github.com/microsoft/fluentui/blob/master/tools/workspace-plugin/src/generators/prepare-initial-release/README.md Use this command to initiate the first release preparation for a package in the preview phase. It automates the necessary steps before publishing to npm. ```bash nx prepare-initial-release --phase=preview ``` -------------------------------- ### Prepare Initial Release for Compat Source: https://github.com/microsoft/fluentui/blob/master/tools/workspace-plugin/src/generators/prepare-initial-release/README.md Use this command to initiate the first release preparation for a compat package. This automates the steps for releasing compat packages to npm. ```bash nx prepare-initial-release --phase=compat ``` -------------------------------- ### Project Structure Overview Source: https://github.com/microsoft/fluentui/blob/master/starter-templates/README.md This is a representation of the project's directory structure, showing the location of starter templates and configuration files. ```bash starter-templates/ โ”œโ”€โ”€ project.json โ”œโ”€โ”€ package.json โ”œโ”€โ”€ README.md โ””โ”€โ”€ src/ โ””โ”€โ”€ react-components-vite/ โ”œโ”€โ”€ README.md โ””โ”€โ”€ ... ``` -------------------------------- ### Gestalt Link Example DOM Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Link component rendered using Gestalt. ```html click here ``` -------------------------------- ### Start Development Server Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/dev-workflow.md Launch the documentation site or Storybook for v9 components using Yarn. Hot module reloading is typically enabled for automatic refreshes on file saves. ```bash yarn start @fluentui/public-docsite // starts the public v8 documentation site. @fluentui/public-docsite-v9 // starts the v9 documentation storybook site. ``` -------------------------------- ### Northstar Carousel Example Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-carousel/library/docs/Migration.md Example of how the react-northstar Carousel was implemented using data props. ```jsx ({ key: item.id, })), }} items={carouselItems} /> ``` -------------------------------- ### Prepare Initial Release for Stable Phase Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/component-implementation-guide.md Use this script to move a component package to the stable phase. Replace 'your-component' with the actual package name. ```bash yarn nx generate prepare-initial-release --project @fluentui/react-your-component-preview --phase=stable ``` -------------------------------- ### ToggleButton Examples Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-button/library/README.md Provides examples of ToggleButton in its default, checked (true/false), and defaultChecked states. ```jsx Toggle volume ``` ```jsx Toggle volume ``` ```jsx Toggle volume ``` ```jsx Toggle volume ``` -------------------------------- ### Prepare Initial Release - Stable Phase Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/new-release-process-v9-packages.md Command to prepare a package for the stable release phase. Use this after the preview phase is complete. Replace 'react-one-preview' with your project name. ```sh yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project react-one-preview --phase=stable ``` -------------------------------- ### Prepare Initial Release - Preview Phase Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/new-release-process-v9-packages.md Command to prepare a package for the preview release phase. Ensure you replace 'react-one-preview' with your actual project name. ```sh yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project react-one-preview --phase=preview ``` -------------------------------- ### Generate Initial Release for Preview Phase Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/release-cycle.md Use the Nx generator `@fluentui/workspace-plugin:prepare-initial-release` with the `--phase=preview` flag to prepare a package for the preview release. ```sh yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project @fluentui/react-one-preview --phase=preview ``` -------------------------------- ### FastDNA Link (Hypertext) Example DOM Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Link component rendered using FastDNA. ```html Hypertext ``` -------------------------------- ### Run Development Commands Source: https://github.com/microsoft/fluentui/blob/master/docs/workflows/contributing.md Commands for starting the development server, building projects, running Storybook, tests, linting, and type checking. ```bash yarn start # Interactive project selector yarn nx run :build # Build specific project yarn nx run :start # Start Storybook for component yarn nx run :test # Run unit tests yarn nx run :test -u # Update snapshots yarn nx run :lint # Lint yarn nx run :type-check # Type check yarn nx run :generate-api # Update API docs ``` -------------------------------- ### Install @fluentui/react-charts Package Source: https://github.com/microsoft/fluentui/blob/master/apps/chart-docsite/src/Introduction.mdx Use npm or yarn to install the necessary charts package for your project. ```bash npm install @fluentui/react-charts ``` -------------------------------- ### Example Icon DOM Structure Source: https://github.com/microsoft/fluentui/blob/master/specs/Icon.md This is an example of the HTML structure for an icon, utilizing SVG elements for rendering. ```html ``` -------------------------------- ### Prepare Initial Release for Stable Source: https://github.com/microsoft/fluentui/blob/master/tools/workspace-plugin/src/generators/prepare-initial-release/README.md Use this command to initiate the first release preparation for a package in the stable phase. This command automates the steps required for a stable npm release. ```bash nx prepare-initial-release --phase=stable ``` -------------------------------- ### Chakra UI Link Example DOM Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Link component rendered using Chakra UI. ```html Chakra UI ``` -------------------------------- ### Carbon Design Link Example DOM Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Link component rendered using Carbon Design. ```html Link ``` -------------------------------- ### Generate Initial Release Preparation Source: https://github.com/microsoft/fluentui/blob/master/tools/workspace-plugin/src/generators/prepare-initial-release/README.md Run this command to generate the necessary files and configurations for the initial release of a package. This is the default command when no specific phase is provided. ```bash yarn nx g @fluentui/workspace-plugin:prepare-initial-release ``` -------------------------------- ### Basic Link Examples Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-link/library/docs/SPEC.md Demonstrates the basic usage of the Link component with different configurations. ```jsx This is a link ``` ```jsx This is a link ``` ```jsx This is a link ``` ```jsx This is a link ``` -------------------------------- ### Base Web Link Example DOM Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Link component rendered using Base Web. ```html Link to Base Web ``` -------------------------------- ### SpinButton Basic Example Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-spinbutton/library/docs/Spec.md A fundamental example showcasing the SpinButton's basic functionality and how formatting can be applied. ```tsx ``` -------------------------------- ### Example Theme Object Source: https://github.com/microsoft/fluentui/blob/master/apps/public-docsite-v9/src/Concepts/Theming.mdx An example of a theme object structure, showing how tokens are represented as key-value pairs. ```tsx const exampleTheme = { borderRadiusSmall: '2px', //... colorNeutralForeground2: '#424242', }; ``` -------------------------------- ### Example Package Label Assignment (v8) Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/shared/build-system/triage-automation.md Illustrates the mapping from component names to package labels for the v8 template. ```text Text -> package: react, Fluent UI react (v8) Menu -> package: react, Fluent UI react (v8) Dialog -> package: react, Fluent UI react (v8) Chart -> package: react-charting, Fluent UI react (v8) ``` -------------------------------- ### Install Dependencies Command Source: https://github.com/microsoft/fluentui/blob/master/tools/react-integration-tester/README.md Command to install dependencies for a specific React major version, caching the results. ```bash rit --react 18 --install-deps ``` -------------------------------- ### Example Story with Sandbox Export Source: https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-storybook-addon-export-to-sandbox/README.md Demonstrates how to configure the sandbox export parameters for a specific story, including required dependencies. ```jsx import React from 'react'; import { Text } from '@fluentui/react-components'; export const Default = () => This is an example of the Text component's usage.; Default.parameters = { exportToSandbox: { provider: 'stackblitz-cloud', bundler: 'vite', requiredDependencies: { react: 'latest', 'react-dom': 'latest', }, }, }; ``` -------------------------------- ### StartEnd Class Source: https://github.com/microsoft/fluentui/blob/master/packages/web-components/docs/web-components.api.md Implements both Start and End interfaces, providing slot elements for start and end content. ```APIDOC ## StartEnd ### Description Implements Start and End interfaces, providing slot elements. ### Class `StartEnd` ### Properties - **end** (HTMLSlotElement) - The slot element for end content. - **start** (HTMLSlotElement) - The slot element for start content. ``` -------------------------------- ### Material-UI Link Example DOM without href Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Material-UI Link rendered as a button when no href is provided. ```html ``` -------------------------------- ### Example Package Label Assignment (Web Components) Source: https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/shared/build-system/triage-automation.md Illustrates the mapping from component names to package labels for the web-components template. ```text Text -> package: web-components Menu -> package: web-components ``` -------------------------------- ### Material-UI Link Example DOM with href Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Material-UI Link rendered as an anchor tag when an href is provided. ```html Link ``` -------------------------------- ### Fabric Link Example DOM without href Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Fabric Link rendered as a button when no href is provided. ```html ``` -------------------------------- ### Fabric Link Example DOM with href Source: https://github.com/microsoft/fluentui/blob/master/specs/Link.md Example of a Fabric Link rendered as an anchor tag when an href is provided. ```html it renders as an anchor tag. ```