Wedges UI Library

repository·main·Indexed 23 days ago

https://github.com/lmsqueezy/wedges

An open-source React UI library built with the Wedges Design System, Radix primitives, and Tailwind CSS. It provides customizable components with full TypeScript support, including Alert, Avatar, AvatarGroup, Badge, and ButtonGroup.

Tokens
30.7K
Snippets
77
Records
213
Agent score
79%

What's inside Wedges

  1. What is Wedges?

    main

    Wedges is an open-source React UI library and design system. It is built using a combination of Radix UI primitives for accessibility and Tailwind CSS for styling.

    Key features include:

    • Pre-built Components: A range of customizable components designed for easy integration into React projects.
    • TypeScript Support: Full type safety for a better developer experience.
    • Design System: Based on a professional design system available for Figma.
  2. How to compose custom Avatars with Avatar.Root

    main

    When you need more control than the standard Avatar component provides, you can use the sub-components. You must wrap these inner components in Avatar.Root to manage the lifecycle and state of the avatar (such as loading status and fallback visibility).

    <Avatar.Root>
      <Avatar.Image src="..." alt="..." />
      <Avatar.Fallback>Fallback Content</Avatar.Fallback>
      <Avatar.Notification />
      <Avatar.Status />
    </Avatar.Root>
  3. Use Themable Colors

    main

    Themable colors are semantic colors that adapt based on the active theme (e.g., light or dark). These allow you to build components that automatically switch appearance when the theme changes.

    Available themable color classes:

    • bg-background (applied to <html> by default)
    • bg-foreground (applied to <html> by default)
    • bg-primary
    • bg-secondary
    • bg-destructive
    • bg-surface
  4. Advanced Tooltip usage with sub-components

    main

    For more control over the tooltip's structure, lifecycle, and rendering (such as using a custom trigger or a portal), use the exported sub-components. This pattern allows you to compose the tooltip manually.

    import { Tooltip } from "@lemonsqueezy/wedges";
    
    <Tooltip.Provider>
      <Tooltip.Root>
        <Tooltip.Trigger />
        <Tooltip.Portal>
          <Tooltip.Content>
            <Tooltip.Arrow />
          </Tooltip.Content>
        </Tooltip.Portal>
      </Tooltip.Root>
    </Tooltip.Provider>
    <Tooltip.Provider>
      <Tooltip.Root>
        <Tooltip.Trigger />
        <Tooltip.Portal>
          <Tooltip.Content>
            <Tooltip.Arrow />
          </Tooltip.Content>
        </Tooltip.Portal>
      </Tooltip.Root>
    </Tooltip.Provider>
  5. Install and use Wedges UI library

    main

    Wedges is an open-source React UI library built using the Wedges Design System, Radix primitives, and Tailwind CSS. It provides pre-built, customizable components with full TypeScript support.

    To use Wedges in your project, visit the Wedges Docs for detailed installation and component usage instructions.