Wired Elements

repository·master·Indexed 27 days ago

https://github.com/rough-stuff/wired-elements

A collection of hand-drawn sketchy web components for wireframes, mockups, and stylized web interfaces. Version 3.0.0-rc.7 includes components such as wired-button, wired-calendar, wired-card, wired-icon, and wired-mat-icon.

Tokens
13.6K
Snippets
43
Records
138
Agent score
95%

What's inside wired-elements

  1. Install and use wired-textarea

    master

    To use the wired-textarea component, install the wired-elements package via npm and import the module into your JavaScript project. You can then use the <wired-textarea> custom element in your HTML.

    Installation

    npm i wired-elements

    Import Methods

    JavaScript Import:

    import { WiredTextarea } from 'wired-elements';
    // or
    import { WiredTextarea } from 'wired-elements/lib/wired-textarea.js';

    HTML Script Tag:

    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-textarea.js?module"></script>

    HTML Usage

    <wired-textarea placeholder="Enter text" rows="6"></wired-textarea>
  2. Install and use wired-button

    master

    To use the wired-button component, install the wired-elements package via npm and import the component into your JavaScript project or load it directly via a script tag.

    Installation

    npm i wired-elements

    Import via JavaScript

    You can import the component using one of the following methods:

    import { WiredButton } from 'wired-elements';
    // or
    import { WiredButton } from 'wired-elements/lib/wired-button.js';

    Load via HTML Script Tag

    Alternatively, load the module directly in your HTML:

    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-button.js?module"></script>

    HTML Usage

    Once loaded, use the <wired-button> tag in your HTML:

    <wired-button>Click Me</wired-button>
    <wired-button disabled>Disabled</wired-button>
    <wired-button elevation="3">Elevation</wired-button>
  3. Install and use wired-link

    master

    The wired-link component is a hand-drawn sketchy Anchor/Link web component. You can install it via npm, import it into your JavaScript modules, or load it directly via a CDN script tag.

    npm i wired-elements
    import { WiredLink } from 'wired-elements';
    // or
    import { WiredLink } from 'wired-elements/lib/wired-link.js';
    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-link.js?module"></script>
    <wired-link href="/more.html">Learn more</wired-link>
  4. Install and use wired-progress-ring

    master

    The wired-progress-ring is a hand-drawn sketchy progress-ring web component. You can install it via npm or load it directly via a script tag.

    Installation

    Install the wired-elements package using npm:

    npm i wired-elements

    Importing the module

    If using a JavaScript bundler, import the component into your code:

    import { WiredProgressRing } from 'wired-elements';
    // or
    import { WiredProgressRing } from 'wired-elements/lib/wired-progress-ring.js';

    Alternatively, load it directly in your HTML using a module script:

    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-progress-ring.js?module"></script>

    HTML Usage

    Use the <wired-progress-ring> tag in your HTML. You can specify the value, min, and max attributes:

    <wired-progress-ring value="25"></wired-progress-ring>
    <wired-progress-ring value="10" min="5" max="15"></wired-progress-ring>
  5. Install and use wired-dialog

    master

    To use the wired-dialog component, install the wired-elements package via npm. You can then import the WiredDialog class into your JavaScript project or load the module directly via a script tag in your HTML. Once loaded, use the <wired-dialog> tag in your HTML markup to wrap your dialog content.

    npm i wired-elements
    import { WiredDialog } from 'wired-elements';
    // or
    import { WiredDialog } from 'wired-elements/lib/wired-dialog.js';
    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-dialog.js?module"></script>
    
    <wired-dialog>
      <p>
        Dialog content here
      </p>
      <div style="text-align: right; padding: 30px 16px 16px;">
        <wired-button id="closeDialog">Close dialog</wired-button>
      </div>
    </wired-dialog>
  6. Install and use wired-radio

    master

    To use the wired-radio component, install the wired-elements package via npm. You can then import the WiredRadio class into your JavaScript project or load the module directly in your HTML using a script tag.

    npm i wired-elements
    import { WiredRadio } from 'wired-elements';
    // or
    import { WiredRadio } from 'wired-elements/lib/wired-radio.js';
    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-radio.js?module"></script>
  7. Install and use wired-input

    master

    To use the wired-input hand-drawn sketchy text input component, install the wired-elements package via npm and import the component into your project. You can also load it directly via a CDN script tag in your HTML.

    npm i wired-elements
    import { WiredInput } from 'wired-elements';
    // or
    import { WiredInput } from 'wired-elements/lib/wired-input.js';
    <script type="module" src="https://unpkg.com/wired-elements/lib/wired-input.js?module"></script>
  8. Use wired-mat-icon in your project

    master

    To use the component, first import the definition into your project, then use the <wired-mat-icon> tag in your HTML. You can specify the icon name and a configuration object for the hand-drawn effect.

    <!-- Import via script tag -->
    <script type="module" src="wired-mat-icon/lib/wired-mat-icon.js"></script>
    
    <!-- Or via module script -->
    <script>
      import "wired-mat-icon";
    </script>
    
    <!-- Usage -->
    <wired-mat-icon
      icon="android"
      config='{"fillStyle": "zigzag", "fill": "#3B5998", "hachureGap": "1.5", "fillWeight": "0.9"}'>
    </wired-mat-icon>