1.1.0 • Published 3 years ago

@pmwcs/button v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Buttons

Buttons communicate the action that will occur when the user touches them.

  • Module @pmwcs/button
  • Import styles:
    • Using CSS Loader
      • import '@pmwcs/button/styles';
    • Or include stylesheets
      • '@material/button/dist/mdc.button.css'
      • '@pmwcs/@pmwcs/icon/icon.css'
      • '@material/ripple/dist/mdc.ripple.css'
  • MDC Docs: https://material.io/develop/web/components/buttons/
<Button label="Button" />
<>
  <Button label="Icon" icon="favorite" />
  <Button label="Trailing" trailingIcon="keyboard_arrow_right" />
  <Button label="Loading" icon={<CircularProgress />} />
</>
<>
  <Button label="Raised" raised />
  <Button label="Unelevated" unelevated />
  <Button label="Outlined" outlined />
  <Button label="Dense" dense />
  <Button label="No Ripple" ripple={false} />
</>
<>
  <Button label="Danger" danger raised />
  <Button label="Danger" danger outlined />
  <Button label="Danger" danger />
</>
<>
  <Button
    label="With Theme"
    raised
    theme={['secondaryBg', 'onSecondary']}
  />
  {/**
    This example uses "accent" to control the color of the Ripple.
    See the documentation on Ripples.
  */}
  <Button label="With Theme" theme="secondary" />
</>
<Button>
  {/** Alternatively pass content as children */}
  As Children
</Button>

Button

The Button component.

Props

NameTypeDescription
childrenReact.ReactNodeContent specified as children.
dangerundefined \| false \| trueUsed to indicate a dangerous action.
denseundefined \| false \| trueMake the Button dense.
disabledundefined \| false \| trueMake the button disabled
activatedundefined \| false \| trueMake the button activated
iconPMWCS.IconPropTAn Icon for the Button
labelReact.ReactNode \| anyContent specified as a label prop.
primaryundefined \| false \| trueMake the button primary.
secondaryundefined \| false \| trueMake the button secondary.
outlinedundefined \| false \| trueMake the button outlined.
raisedundefined \| false \| trueMake the Button raised.
rippleRipplePropTAdds a ripple effect to the component
trailingIconPMWCS.IconPropTA trailing icon for the Button
unelevatedundefined \| false \| trueMake the button unelevated.

References