
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@fluentui/react-bindings
Advanced tools
A set of components and hooks to build components libraries and UI kits.
@fluentui/react-bindingsA set of reusable components and hooks to build component libraries and UI kits.
NPM
npm install --save @fluentui/react-bindings
Yarn
yarn add @fluentui/react-bindings
useAccesibility()A React hook that provides bindings for accessibility behaviors.
The example below assumes a component called <Image> will be used this way:
const imageBehavior: Accessibility<{ disabled: boolean }> = props => ({
attributes: {
root: {
'aria-disabled': props.disabled,
tabIndex: -1,
},
img: {
role: 'presentation',
},
},
keyActions: {
root: {
click: {
keyCombinations: [{ keyCode: 13 /* equals Enter */ }],
},
},
},
});
type ImageProps = {
disabled?: boolean;
onClick?: (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
src: string;
};
const Image: React.FC<ImageProps> = props => {
const { disabled, onClick, src, ...rest } = props;
const getA11Props = useAccessibility(imageBehavior, {
mapPropsToBehavior: () => ({
disabled,
}),
actionHandlers: {
click: (e: React.KeyboardEvent<HTMLDivElement>) => {
if (onClick) onClick(e);
},
},
});
return (
<div {...getA11Props('root', { onClick, ...rest })}>
<img {...getA11Props('img', { src })} />
</div>
);
};
useStyles()A React hook that provides bindings for usage CSSinJS styles and Fluent theming.
The example below assumes a component called <Text> will be used this way:
type TextComponentProps = {
className?: string;
color?: string;
};
const Text: React.FunctionComponent<TextComponentProps> = props => {
const { className, children, color } = props;
const { classes } = useStyles('Text', {
className: 'ui-text',
mapPropsToStyles: () => ({ color }),
});
return <span className={classes.root}>{children}</span>;
};
const { classes } = useStyles(
displayName: string,
options: UseStylesOptions<Props>,
)
displayName - a component name to lookup in themeoptions.className - optional, a special class name that will be always added to the root slotoptions.mapPropsToStyles - optional, a set of props that will be passed style functions, only primitives are allowedoptions.rtl - optional, sets RTL modeuseUnhandledProps()A React hook that returns an object consisting of props beyond the scope of the component. Useful for getting and spreading unknown props from the user.
The example below assumes a component called <Text> will be used this way:
type TextComponentProps = React.HTMLAttributes<HTMLSpanElement> * {
className?: string;
};
const Text: React.FunctionComponent<TextComponentProps> = props => {
const { className, children } = props;
const unhandledProps = useUnhandledProps(['className'], props);
return <span {...unhandledProps} className={classes.root}>{children}</span>;
};
const unhandledProps = useUnhandledProps(handledProps, props);
unhandledProps - an object with unhandled props by componenthandledProps - an array with names of handled propsprops - an object with all props that are passed to a componentFAQs
A set of components and hooks to build components libraries and UI kits.
We found that @fluentui/react-bindings demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.