-
-
Save marcosteam/f1bb15e047c93940b7b9d6f355dd9c33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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