labsUI
labsUI is a clean, composable React component library with one smooth spring for every motion. You copy components into your project and own the code. Built for Next.js 16 and Tailwind CSS v4; install with npm, pnpm, yarn or Bun (recommended).
Built with labsUI
Compositions where several components work together. Each one opens its page with the code, the props and the install command.
- NewsletterEmail signup: InputGroup with the submit Button inside, native email validation, a loading → success toast and an in-place success state on the button.
- FormsInput, Textarea, Label and Switch: smooth focus rings, native :user-invalid validation (red only after interaction), aria-invalid, auto-growing textarea with an optional character count, and a spring switch.
Create account
Focus, invalid and disabled states.
- PricingPlan cards with a monthly / yearly segmented switch.
Hobby
One server, the essentials.
$0/ month, billed monthly
- 1 server
- Slash commands
- 7-day logs
Pro
PopularFor growing communities.
$9/ month, billed monthly
- 10 servers
- Custom commands
- 90-day logs
- Clip uploads
Network
Many servers, one dashboard.
$29/ month, billed monthly
- Unlimited servers
- Role sync
- Audit export
- Priority support
- Data TableTable with columns as data: search across every column, sortable headers, checkbox selection that survives paging, a ⋯ menu per row, bulk actions in the toolbar and pagination.
Actions Wade Howard4,623 Leslie Warren4,595 Guy Williamson4,218 Esther Howard4,190 Kristin Williamson3,785 Cameron Howard3,757 1–6 of 27
- Command⌘K palette: filterable groups, arrow-key highlight, Enter to run, keyword matching.No results.SuggestionsCalendarSearch emojiCalculatorSettingsProfile⌘PBilling⌘BSettings⌘S
↑ ↓ to move · Enter to run · try the site-wide palette with ⌘K / Ctrl K
- Stat TileAdmin dashboard metric: value, a delta Badge that is green when the change is good news (invert for errors and latency), and an area Chart of the trend.
Revenue
$48,290
+12.5% vs last monthRevenue trend month Revenue May $31,200 Jun $33,800 Jul $36,100 Aug $39,400 Sep $42,900 Oct $48,290 Failed commands
0.42%
−18% vs last monthFailed commands trend month Failed commands May 0.9% Jun 0.81% Jul 0.66% Aug 0.61% Sep 0.51% Oct 0.42% - Date PickerField-styled button that opens a Calendar in a Popover, focused on the picked day.
- StepperMulti-step form (questionnaire, checkout, setup wizard).
Get started
labsUI isn't a dependency you import from a package. The CLI copies each component's source into your project, so you own it and can change anything.
Check the requirements
React 19, Tailwind CSS v4 and a path alias in
tsconfig.json("@/*": ["./src/*"], the Next.js default). Any React framework works; the examples use the Next.js App Router. The CLI needs Node.js 22 or newer, or Deno.Run init once
Adds
styles/labsui.css(colors, accents, animations) and imports it right after Tailwind, plus the theme helpers and the motion provider. Any package manager works:bunx,pnpm dlx,yarn dlxordeno run -A jsr:@kznlabs/labsui. Bun is recommended; labsUI is built with it.Wire the root layout
The theme script picks light or dark before the first paint; the motion provider gives every animation the same spring and honors reduced motion.
import type { ReactNode } from "react";import { MotionProvider } from "@/components/motion-provider";import { themeScript } from "@/lib/theme";import "./globals.css";export default function RootLayout({ children }: { children: ReactNode }) { return ( <html lang="en" suppressHydrationWarning> <head> {/* Sets light/dark and the accent before paint: no flash. */} <script dangerouslySetInnerHTML={{ __html: themeScript }} /> </head> <body> <MotionProvider>{children}</MotionProvider> </body> </html> );}Add components
Each component brings what it imports (other components, helpers, npm packages). Every section below shows its own command, a live demo, the code and its props.
import { Button } from "@/components/ui/button";export function Save() { return <Button successLabel="Saved!">Save</Button>;}Make it yours
Colors are CSS variables in
labsui.css; set an accent on<html data-accent="purple">or at runtime. Every component acceptsclassNamefor one-off changes.import { setAccent, setTheme } from "@/lib/theme";setTheme("dark"); // or "light"; follows the OS until set, then rememberedsetAccent("purple"); // red, orange, yellow, green, blue, purple, pink, slate
All components 82
Each has its own page: a live demo, the code, the props and what it installs. Search them from anywhere with the palette in the header.
Actions & inputs
- ButtonFive variants, four sizes, spring press feedback, an animated loading spinner and in-place success state, a two-step confirm that swaps the label on first click, and a configurable swap direction.
- FormsInput, Textarea, Label and Switch: smooth focus rings, native :user-invalid validation (red only after interaction), aria-invalid, auto-growing textarea with an optional character count, and a spring switch.
- Theme ToggleLight/dark icon switch with spring rotate-swap; follows the OS until first use.
- Button GroupJoins buttons into one strip that shares borders, corners and active states.
- Accent PickerAccent color row: eight swatches (red to slate) that retint primary, focus rings, selection, switches and checkboxes app-wide.
- Search InputSearch field built on Input: leading icon, spring-in clear button, Esc to clear, and an optional focus shortcut ("/" or mod+k) with a Kbd hint.
- FieldLabel, control, description and error as one unit.
- Input GroupServer-safe wrapper that fuses an Input with icons, text (https://, USD) or buttons into one field with a shared border and focus ring.
- CheckboxNative checkbox with a spring-drawn check mark and an indeterminate state for select-all rows.
- Radio GroupNative radios in a fieldset with a legend: browser arrow keys and form submit, a dot that springs in, optional per-option descriptions, vertical or horizontal.
- SliderSlider over native range inputs: thin accent track, white knob that lifts while held.
- Toggle GroupSegmented control of toggle buttons.
- Native SelectA real <select> with option groups: native picker on phones, no-JS forms, native required validation.
- Number InputNative number field with −/+ buttons: arrow keys, min/max/step validation and form submit from the platform; clamps on blur, rounds to the step's precision.
- SelectSingle-choice listbox styled like Input, with groups, icons and disabled options.
- Attachment & DropzoneFile chips with image thumbnails or type icons, size, a springing upload bar, error state and remove; the list springs chips in and closes the gap.
- StepperMulti-step form (questionnaire, checkout, setup wizard).
- CalendarMonth grid on the WAI-ARIA date-grid pattern: single date or range with a hover preview, min/max and custom disabled days, months that slide in from the direction of travel.
- Date PickerField-styled button that opens a Calendar in a Popover, focused on the picked day.
- Input OTPOne-time code in separate slots, backed by one real input: paste and SMS autofill work, screen readers hear one field.
- ComboboxA Select you can type into: the query filters by label and keywords (prefix matches first), arrows move, Enter picks.
- Tag InputFree-form tags: Enter or a separator adds, Backspace removes the last, pasting a list adds them all.
Layout
- CardComposable surface: header, title, description, content and footer.
- AccordionSingle or multiple panels with spring height animation.
- AppWindowWindow container with close / minimize / zoom controls, title, custom header slot and actions.
- CollapsibleA single show/hide region with a spring height animation and rotating chevron.
- SeparatorServer-safe hairline, horizontal or vertical, decorative by default, with an optional centered label like "or".
- Aspect RatioServer-safe box locked to a ratio (16:9 thumbnails, 9:16 clips).
- Scroll AreaOverlay scrollbars: thin thumbs that fade in while scrolling or on hover, widen under the pointer and drag.
- ResizableSplit panes for admin layouts, docs and editors.
Data display
- Badge & PillMinimal status tags.
- AvatarImage with initials fallback on error, three sizes and online/away/busy/offline dots.
- Message BubbleUser/assistant chat bubbles with avatar slot, streaming dots and copyable code blocks.
- AvatarGroupOverlapping avatars with a +N overflow chip.
- QuoteSemantic figure, blockquote and figcaption.
- KbdServer-safe key caps for shortcut hints.
- MeterServer-safe gauge for a value in a known range (storage, quota, server load, password strength).
- RatingStar rating on native radios (arrow keys, forms) with hover preview, or readOnly display with fractional stars for averages.
- Relative TimeSelf-updating “5 minutes ago” in a semantic <time> with the full date as its title.
- EmptyServer-safe empty state: icon tile, title, one helpful sentence and the next action.
- SkeletonServer-safe loading placeholders that pulse (static under reduced motion).
- TableServer-safe semantic <table> in a scrolling card: header, body, footer and caption, striped rows, tinted selected rows, and sortable headers that set aria-sort and flip their arrow.
- Data TableTable with columns as data: search across every column, sortable headers, checkbox selection that survives paging, a ⋯ menu per row, bulk actions in the toolbar and pagination.
- ChartLine, area and bar (grouped or stacked) charts in SVG with a colorblind-validated eight-color palette that keeps each series' color.
- CarouselNative scroll-snap row, so touch, trackpad and no-JS scrolling work, with spring-driven arrows, page dots, arrow keys and mouse drag that throws to the next snap point.
- MarkerHighlighter-pen <mark> in four tints that wraps cleanly across lines and can draw itself on, left to right, when it scrolls into view.
- CodeShiki-highlighted code that follows light and dark through light-dark() token colors, as a block, an inline one-liner or a tabbed file panel.
- TerminalTerminal window.
- TimelineServer-safe ordered list of events on a rail: icon or dot markers with status colors, machine-readable <time>, title and an optional body.
Overlays & feedback
- DialogPortal modal with blurred backdrop, spring scale-in, focus trap, Esc and scroll lock.
- ToastStacked notifications.
- PopoverNon-modal panel anchored to a Button for filters, pickers and quick edits.
- TooltipShort label on hover or keyboard focus, also wired as the trigger's aria-describedby.
- Hover CardRich preview (profile, product, clip) that opens after a hover delay or keyboard focus.
- Context MenuRight-click menu for an area, opening at the pointer and flipping at screen edges.
- AlertServer-safe inline banner: tinted surface, colored icon, title, description and an optional action.
- ProgressAccent bar that springs to each new value, with an optional label and percentage.
- Dropdown MenuAction menu anchored to a Button: items with icons and shortcuts, checkbox and radio items, labels, separators, destructive variant.
- DrawerEdge panel (left, right, top, bottom) that springs in and swipes away.
- Command⌘K palette: filterable groups, arrow-key highlight, Enter to run, keyword matching.
- ConfirmPromise-based confirm dialog called like toast: await confirm({ title, description, destructive }) resolves true or false.
- SpinnerServer-safe activity indicator: eight spokes in currentColor, three sizes, its own status label (or silent inside a parent that announces).
Motion
- Custom CursorOptional spring cursor that expands over interactive elements.
- CountToSprings a number up from a start value once it scrolls into view.
- RevealScroll reveal: content fades and rises on a spring the first time it enters the viewport.
- TypewriterTypes out text character-by-character with optional phrase cycling and pulsing cursor.
- TextSwapSpring-powered text morphing and ticker.
Blocks
- PricingPlan cards with a monthly / yearly segmented switch.
- TestimonialA large Quote with its author, and everyone else who agrees as an overlapping AvatarGroup.
- Stats StripHeadline numbers, each card a <dl>: cards rise in turn with Reveal, then each number springs up with CountTo.
- Product CardShop tile: photos in an AspectRatio (a swipeable Carousel with dots when there are several), sale price, Badge and add-to-cart Button.
- Clip CardVideo tile: AspectRatio thumbnail (16:9 or 9:16), duration Badge, watched Progress along the bottom, and a ContextMenu of actions.
- Stat TileAdmin dashboard metric: value, a delta Badge that is green when the change is good news (invert for errors and latency), and an area Chart of the trend.
- ChangelogRelease notes on a Timeline: newest release highlighted, changes typed New / Improved / Fixed with Badges, and a Kbd shortcut to try the headline feature.
- NewsletterEmail signup: InputGroup with the submit Button inside, native email validation, a loading → success toast and an in-place success state on the button.
- Site HeaderSticky, translucent site header from one nav array: brand, NavigationMenu panels from md up, a right Drawer with the same links below it, and your actions on the right.