Skeleton
Tier 0: Zero-JSPulsing placeholder for loading states
$npx nnui add skeleton
copy$npm install nnui-kit
copyInteractive Preview & Code
<!-- Circular Avatar Skeleton + Text Lines -->
<div style="display: flex; gap: 1rem; align-items: center;">
<div data-ui="skeleton" data-shape="circle" style="width: 48px; height: 48px;"></div>
<div style="display: flex; flex-direction: column; gap: 0.5rem; flex: 1;">
<div data-ui="skeleton" style="height: 16px; width: 80%;"></div>
<div data-ui="skeleton" style="height: 12px; width: 50%;"></div>
</div>
</div>
import React, { useState } from 'react';
import 'nnui-kit'; // Registers universal Light-DOM elements
export default function SkeletonDemo() {
const [tab, setTab] = useState('all');
const [val, setVal] = useState(50);
const [selected, setSelected] = useState('');
const [query, setQuery] = useState('');
return (
<!-- Circular Avatar Skeleton + Text Lines -->
<div style="display: flex; gap: 1rem; align-items: center;">
<div data-ui="skeleton" data-shape="circle" style="width: 48px; height: 48px;"></div>
<div style="display: flex; flex-direction: column; gap: 0.5rem; flex: 1;">
<div data-ui="skeleton" style="height: 16px; width: 80%;"></div>
<div data-ui="skeleton" style="height: 12px; width: 50%;"></div>
</div>
</div>
);
}
<script setup>
import { ref } from 'vue';
import 'nnui-kit'; // Registers universal Light-DOM elements
const activeTab = ref('all');
const sliderValue = ref(50);
const selected = ref('');
const query = ref('');
const handleSelect = (val) => {
console.log('Selected:', val);
};
</script>
<template>
<!-- Circular Avatar Skeleton + Text Lines -->
<div style="display: flex; gap: 1rem; align-items: center;">
<div data-ui="skeleton" data-shape="circle" style="width: 48px; height: 48px;"></div>
<div style="display: flex; flex-direction: column; gap: 0.5rem; flex: 1;">
<div data-ui="skeleton" style="height: 16px; width: 80%;"></div>
<div data-ui="skeleton" style="height: 12px; width: 50%;"></div>
</div>
</div>
</template>
<script>
import 'nnui-kit';
let activeTab = $state('all');
let sliderValue = $state(50);
let selected = $state('');
</script>
<!-- Circular Avatar Skeleton + Text Lines -->
<div style="display: flex; gap: 1rem; align-items: center;">
<div data-ui="skeleton" data-shape="circle" style="width: 48px; height: 48px;"></div>
<div style="display: flex; flex-direction: column; gap: 0.5rem; flex: 1;">
<div data-ui="skeleton" style="height: 16px; width: 80%;"></div>
<div data-ui="skeleton" style="height: 12px; width: 50%;"></div>
</div>
</div>
How to Utilize
NNUI-KIT components live directly in the document Light DOM. You can use them via declarative HTML, with our first-class React wrapper, or platform-natively in Svelte, Vue, Astro, and HTMX:
React 18 & 19 (Next.js 15 App Router)
import 'nnui-kit/css';
import 'nnui-kit/client';
import { Skeleton } from 'nnui-kit/react';
Universal Web Components (Vue 3, Svelte 5, Astro, HTMX)
<!-- Automatically registers <ui-skeleton> and <nnui-skeleton> -->
import 'nnui-kit/css';
import 'nnui-kit/client';
Platform Features
Zero Shadow DOM
Element lives in the Light DOM. Tailwind and global CSS apply directly.
persist="url | local"
Add declarative persistence attribute to auto-sync state with URL search params.
sync="cross-tab"
Synchronize changes across all open browser tabs via BroadcastChannel.