Skip to content

Instantly share code, notes, and snippets.

@marcosteam
Created June 10, 2020 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcosteam/f1bb15e047c93940b7b9d6f355dd9c33 to your computer and use it in GitHub Desktop.
Save marcosteam/f1bb15e047c93940b7b9d6f355dd9c33 to your computer and use it in GitHub Desktop.
import * as React from "react";
import * as ReactDOM from 'react-dom'
import { DefaultButton, PrimaryButton, Stack, IStackTokens } from '@fluentui/react';
export interface IButtonExampleProps {
// These are set based on the toggles shown above the examples (not needed in real code)
disabled?: boolean;
checked?: boolean;
}
// Example formatting
const stackTokens: IStackTokens = { childrenGap: 40 };
export const ButtonDefaultExample: React.FunctionComponent<IButtonExampleProps> = props => {
const { disabled, checked } = props;
return (
<Stack horizontal tokens={stackTokens}>
<DefaultButton text="Standard" onClick={_alertClicked} allowDisabledFocus disabled={disabled} checked={checked} />
<PrimaryButton text="Primary" onClick={_alertClicked} allowDisabledFocus disabled={disabled} checked={checked} />
</Stack>
);
};
function _alertClicked(): void {
alert('Clicked');
}
ReactDOM.render(<ButtonDefaultExample />, document.getElementById('main'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment