Skip to content

gusvega-dev/gus-ui-library

Repository files navigation

@gusvega/ui

React UI component library built on Tailwind CSS. Pre-compiled styles with built-in theme tokens. No separate tokens package required.

Component Status

Actions

  • Button — primary | secondary | ghost | inverted, sm | md | lg, disabled

Form

  • Input — forwardRef, error state, disabled
  • Label — required marker
  • Textarea — forwardRef, resizable
  • Checkbox — controlled, disabled
  • Radio — controlled, disabled
  • Switch — controlled, disabled
  • Select — native styled, controlled
  • FormField — Label + Input + error message compound
  • Slider — range input (planned)
  • DatePicker — (planned)
  • FileUpload — (planned)

Data Display

  • Badge — default | secondary | outline
  • Avatar — 3 sizes, 3 colors, image support, stackable
  • Tag — with optional remove button
  • Stat — metric with optional trend
  • Table — Table, TableHeader, TableBody, TableRow, TableHead, TableCell
  • Code — inline + block variants
  • Kbd — keyboard shortcut key
  • Tooltip — (planned, requires positioning)
  • Timeline — (planned)

Feedback

  • Spinner — 3 sizes
  • Progress — animated fill bar
  • Alert — default | outline | filled with optional title
  • Skeleton — shimmer loading placeholder
  • Toast — (planned, requires context/portal)
  • Banner — (planned)

Navigation

  • Link — default | muted | underline
  • Breadcrumb — with separator
  • Tabs — Tabs | TabsList | TabsTrigger | TabsContent
  • Pagination — (planned)
  • Navbar — (planned as a compound)

Layout

  • Card — Card | CardHeader | CardContent | CardFooter
  • Separator — horizontal / vertical
  • Stack — row / col with gap and alignment
  • Grid — (planned)
  • Container — (planned)

Overlay

  • Dialog / Modal — (planned, requires portal)
  • Dropdown — (planned, requires positioning)
  • Popover — (planned, requires positioning)
  • Sheet — (planned, requires portal)

Installation

React UI component library built on top of Tailwind CSS. Styles are pre-compiled and the default theme ships inside the library. Published to npm.

Installation

npm install @gusvega/ui

Usage

  1. Import the styles once at your app entry point:
import '@gusvega/ui/style.css';
  1. Import and use components:
import { Button, Input, Card, CardHeader, CardContent } from '@gusvega/ui';

export default function App() {
  return (
    <Card>
      <CardHeader>Welcome</CardHeader>
      <CardContent>
        <Input placeholder="Enter name..." />
        <Button variant="primary">Submit</Button>
      </CardContent>
    </Card>
  );
}

Theme Overrides

The library ships with built-in theme values for colors, spacing, and typography. The simplest way to customize them is to override the CSS variables after importing @gusvega/ui/style.css.

Option 1: Override in CSS

:root {
  --gus-color-neutral-900: 15 23 42;
  --gus-color-neutral-100: 241 245 249;
  --gus-font-family-sans: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --gus-space-4: 1.125rem;
}

Option 2: Override in React with a helper

import { createThemeVariables } from '@gusvega/ui';

const themeVars = createThemeVariables({
  colors: {
    neutral: {
      900: '#0f172a',
      100: '#f1f5f9',
    },
  },
  typography: {
    fontFamily: {
      sans: ['Satoshi', 'ui-sans-serif', 'system-ui', 'sans-serif'],
    },
  },
});

export function App() {
  return <div style={themeVars}>{/* your UI */}</div>;
}

createThemeVariables returns CSS custom properties, so the theme can be applied globally or scoped to a single subtree.

Component API

Actions

  • Buttonvariant: "primary" | "secondary" | "ghost" | "inverted", size: "sm" | "md" | "lg"
  • Linkvariant: "default" | "muted" | "underline"

Forms

  • Inputtype, placeholder, error, disabled, forwardRef
  • Label — with optional required marker
  • Textarearows, resizable, disabled, forwardRef
  • Checkboxchecked, onChange, disabled
  • Radiochecked, onChange, disabled
  • Switchchecked, onChange, disabled
  • Selectoptions, value, onChange
  • FormField — compound component (Label + Input + error)

Data Display

  • Badgevariant: "default" | "secondary" | "outline"
  • Avatarsize: "sm" | "md" | "lg", color, image
  • Tag — with optional remove button
  • Stat — metric with optional trend indicator
  • TableTable, TableHeader, TableBody, TableRow, TableHead, TableCell
  • Code — inline and block variants with syntax highlighting support
  • Kbd — keyboard shortcut display
  • Progress — animated progress bar with percentage

Feedback

  • Alertvariant: "default" | "outline" | "filled", optional title
  • Spinnersize: "sm" | "md" | "lg"
  • Skeleton — shimmer loading placeholder

Navigation

  • Breadcrumb — with custom separator
  • TabsTabs, TabsList, TabsTrigger, TabsContent

Layout

  • CardCard, CardHeader, CardContent, CardFooter
  • Separator — horizontal or vertical
  • Stackdirection: "row" | "col", gap, alignment utilities

Development

# Install and build library
cd ../gus-ui-library && npm install && npm run build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors