import * as React from 'react'; import DocPage from '../components/DocPage/DocPage'; import GuidesNavigationFooter from '../components/GuidesNavigationFooter'; import { link, code } from '../utils/helpers'; import { CodeSnippet } from '@fluentui/docs-components'; import { Header } from '@fluentui/react-northstar'; const Category = props =>
; const Question = props =>
; const Answer = props =>

{props.content}

; export default () => (
  • {link('General', '#General')}
    • {link('Does Fluent UI support mobile?', '#does-fluent-ui-support-mobile')}
    • {link( "How can @mixins be used in the Fluent UI's styles?", '#how-can-mixins-be-used-in-the-fluent-uis-styles', )}
    • {link('How to use Links and React-Router?', '#how-to-use-links-and-react-router')}
    • {link('How can I set default value of Form.Field?', '#how-can-i-set-default-value-of-form-field')}
    • {link( 'Is there an onLoad or equivalent event for Image components so I can run a function after an image loads?', '#is-there-an-onload-or-equivalent-event-for-image-components-so-i', )}
    • {link( "What's the difference between Flex, Grid, Layout, Box and Segment components?", '#whats-the-difference-between-flex-grid-layout-box-and-segment-co', )}
  • {link('Teams Specific', '#teams-specific')}
    • {link('How to add Icons to Fluent UI?', '#how-to-add-icons-to-fluent-ui')}
    • {link('How can I reset or replace existing fonts?', '#how-can-i-reset-or-replace-existing-fonts')}
As the styles in Fluent UI are defined using CSS in JS, mixins can be defined as simple functions that can be reused on multiple places.
For example, in Fluent UI the method 'getBorderFocusStyles' is re-used multiple times in many component styles.

} /> We recommend to render links from React Router as Buttons as below: `} />

} /> You need to set the default value on the component used in the control slot. `} />

} /> Just as with vanilla React, all HTML props are supported on all Fluent UI components. Just pass onLoad or onError to the component you want to put the prop on. alert('Loaded')} onError={() => alert('Error')} /> `} />

} /> What's the difference between {code('Flex')}, {code('Grid')}, {code('Layout')}, {code('Box')} and{' '} {code('Segment')} components?

{code('Flex')}, {code('Grid')} and {code('Layout')} components handle layout aspects. The {code('Flex')}{' '} component is for laying out items in one direction, while the {code('Grid')} component is made for two dimensional layouts. Visit the {link('Layout guide', '/layout')} page for a detailed comparison between{' '} {code('Flex')} and {code('Grid')}.

The {code('Layout')} component is now deprecated. Its purpose was arrangement of the content of a component.{' '} {code('Flex')} or {code('Grid')} component should be used instead of the {code('Layout')} component.

{code('Box')} is a utility component that is often used by Fluent UI to implement higher-level components. By default, it renders styled {code('div')} element.

The cases when client might want to use it are very exceptional, and all are about applying custom styles to rendered {code('div')} element. However, more robust approach that won't break theming consistency is to instead create a custom component and define related styles as part of a theme. Visit{' '} {link('Integrate Custom Components', '/integrate-custom-components')} page to see how this can be done.

{link('Segment', '/components/segment')} groups related content together. It shouldn't be used to handle layout aspects.

} /> Teams should be using SVG icons only. The process for adding new icons in the `@fluentui/react-icons-northstar` package is described in{' '} {link('PR 12571', 'https://github.com/microsoft/fluentui/pull/12571')}.

} />

As each theme is reqular JS object you can reassign properties:

} /> );