Skip to content

About

Web Components UI library for building wireframes and prototypes

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

Wireframes

Wireframes is a set of Web Components for building wireframes and prototypes in any project or framework.

Released under the BSD license. npm downloads/month PRs welcome! Follow me on Twitter

Wireframes

Installation

Install the package:

npm install wireframes

Import it once in your application entry point. This registers all wf-* custom elements; no framework-specific package is required.

import 'wireframes';

To load it without a package manager, use the CDN build:

<script type="module" src="https://cdn.jsdelivr.net/npm/wireframes/lib/index.js"></script>

See the project examples for working integrations.

Framework integration

The components are standard custom elements, so you can use them directly in HTML templates. Import wireframes once in the application entry point, or follow the framework-specific notes below.

React

Use the elements directly in JSX. With React 18, use kebab-case attributes such as aspect-ratio. For TypeScript, add /// <reference types="wireframes/react" />.

Vue

Tell Vue that wf-* tags are custom elements:

app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('wf-');

You can also register only selected components instead of importing the full library:

import { defineWfButton } from 'wireframes';

defineWfButton();

Svelte

Import the package once from your app entry point or a component:

<script>
  import 'wireframes';
</script>

<wf-button>Click me</wf-button>

In SvelteKit, import it on the client with onMount:

<script>
  import { onMount } from 'svelte';

  onMount(() => import('wireframes'));
</script>

Next.js

In the App Router, load the package from a client component so its custom elements are registered in the browser:

/// <reference types="wireframes/react" />
'use client';

import { useEffect } from 'react';

export function WireframesButton() {
  useEffect(() => {
    import('wireframes');
  }, []);

  return <wf-button>Click me</wf-button>;
}

Usage

<wf-image aspect-ratio="16/9" />

<wf-title>
    Hello world!
</wf-title>

<wf-button>
    Click me!
</wf-button>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

BSD-3-Clause

About

Web Components UI library for building wireframes and prototypes

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages