JSPM

@hawk-ui/button

2.10.9
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 331
    • Score
      100M100P100Q79541F
    • License MIT

    hawk-ui: Basic Button Component

    Package Exports

    • @hawk-ui/button

    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 (@hawk-ui/button) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    To install a component run

    $ npm install @hawk-ui/button --save

    Please import CSS styles via

    @import '/path__to__node_modules/@hawk-ui/button/dist/index.min.css

    Usage

    Simple Button:

    Demo

    import Button from '@hawk-ui/button';
    <div style={{ display: 'flex', justifyContent: 'space-around' }}>
      <Button
        type="button"
        variant="text"
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Text Button</span>
      </Button>
    
      <Button
        type="button"
        variant="outlined"
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Outlined Button</span>
      </Button>
    
      <Button
        type="button"
        variant="contained"
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Contained Button</span>
      </Button>
    </div>

    Disabled Button:

    Demo

    import Button from '@hawk-ui/button';
    <div style={{ display: 'flex', justifyContent: 'space-around' }}>
      <Button
        type="button"
        variant="text"
        isDisabled
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Text Button</span>
      </Button>
    
      <Button
        type="button"
        variant="outlined"
        isDisabled
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Outlined Button</span>
      </Button>
    
      <Button
        type="button"
        variant="contained"
        isDisabled
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Contained Button</span>
      </Button>
    </div>

    Icon Button:

    Demo

    import Button from '@hawk-ui/button';
    <div style={{ display: 'flex', justifyContent: 'space-around' }}>
      <Button
        type="button"
        variant="text"
        icon="fa fa-star"
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Text Button</span>
      </Button>
      <Button
        type="button"
        variant="outlined"
        icon="fa fa-star"
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Outlined Button</span>
      </Button>
      <Button
        type="button"
        variant="contained"
        icon="fa fa-star"
        onClick={() => { window.alert('Button Was Clicked'); }}
      >
        <span>Contained Button</span>
      </Button>
    </div>