Wireframes is a set of Web Components for building wireframes and prototypes in any project or framework.
Install the package:
npm install wireframesImport 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.
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.
Use the elements directly in JSX. With React 18, use kebab-case attributes such as aspect-ratio. For TypeScript, add /// <reference types="wireframes/react" />.
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();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>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>;
}<wf-image aspect-ratio="16/9" />
<wf-title>
Hello world!
</wf-title>
<wf-button>
Click me!
</wf-button>Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
BSD-3-Clause
