Skip to content

What is Stack / Box aquivalent in Fluent UI V2 and best practice on accessing design tokens #32836

Closed Answered by mainframev
SBArbeit asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @SBArbeit 👋🏻

Regarding tokens and their usage, styling in general, please take a look at the:

Tokens are exposed from @fluentui/react-components, so you can use them as following:

import { tokens } from '@fluentui/react-components';

const useStyles = makeStyles({
  row: {
    display: 'flex',
    gap: tokens.spacingHorizontalL,
  },
});


const Component = () => {
  const styles = useStyles();

  return (
    <div className={styles.row}>
      <div>1</div>
      <div>2</div>
      <div>3</div>
    </div>
  );
};

In v9 we do not provide Stack and StackItem as in Fluent UI Fabric UI. We have a shim components for migration purposes.

The Stack an…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SBArbeit
Comment options

Answer selected by SBArbeit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants