JSPM

@rmwc/button

14.0.1-alpha.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18005
  • Score
    100M100P100Q129684F
  • License MIT

RMWC Button component

Package Exports

  • @rmwc/button
  • @rmwc/button/README.md
  • @rmwc/button/dist/index.js
  • @rmwc/button/next/index.js
  • @rmwc/button/styles
  • @rmwc/button/styles.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rmwc/button) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Buttons

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

  • Module @rmwc/button
  • Import styles:
    • Using CSS Loader
      • import '@rmwc/button/styles';
    • Or include stylesheets
      • '@material/button/dist/mdc.button.css'
      • '@rmwc/@rmwc/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>
<>
  {/** Wrapping a button in TouchTargetWrapper will automatically set its `touch` prop to true. */}
  <TouchTargetWrapper>
    <Button>Touch Accessible</Button>
  </TouchTargetWrapper>
</>

Button

The Button component.

Props

Name Type Description
children React.ReactNode Content specified as children.
danger undefined | false | true Used to indicate a dangerous action.
dense undefined | false | true Make the Button dense.
disabled undefined | false | true Make the button disabled
icon RMWC.IconPropT An Icon for the Button
label React.ReactNode | any Content specified as a label prop.
outlined undefined | false | true Make the button outlined.
raised undefined | false | true Make the Button raised.
touch undefined | false | true Makes the button more touch friendly. This will automatically be set true if used inside of TouchTargetWrapper.
trailingIcon RMWC.IconPropT A trailing icon for the Button
unelevated undefined | false | true Make the button unelevated.