🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@soybeanjs/ui

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soybeanjs/ui

SoybeanUI is built on top of SoybeanHeadless, providing a collection of styled components for Vue 3.

latest
Source
npmnpm
Version
0.29.3
Version published
Maintainers
1
Created
Source

@soybeanjs/ui

English | 中文

license npm version npm downloads github stars

An elegant, modern, accessible UI component library with shadcn-like design for Vue 3, built on top of @soybeanjs/headless.

📖 Introduction

@soybeanjs/ui provides ready-to-use styled components powered by UnoCSS and @soybeanjs/cva class-variance recipes. Each component is an S-prefixed wrapper around the corresponding @soybeanjs/headless primitive, following the style injection pattern: styled wrappers compute classes and inject them via provide{Name}Ui, which headless components read through useUiContext().

// Style injection — one-way data flow
const ui = computed(() => accordionVariants({ size: props.size }, props.ui, { root: props.class }));
provideAccordionUi(ui); // headless reads this via useAccordionUi()

📦 Installation

pnpm add @soybeanjs/ui

🚀 Usage

1. Import Styles

Import the pre-built UnoCSS stylesheet in your main entry file (e.g., main.ts):

import '@soybeanjs/ui/styles.css';

Use unplugin-vue-components with the built-in resolver for auto-importing:

// vite.config.ts
import Components from 'unplugin-vue-components/vite';
import UiResolver from '@soybeanjs/ui/resolver';

export default defineConfig({
  plugins: [
    Components({
      resolvers: [UiResolver()]
    })
  ]
});

3. Nuxt Module

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@soybeanjs/ui/nuxt']
});

4. Direct Import

<script setup>
import { SButton, SDialog } from '@soybeanjs/ui';
</script>

<template>
  <SDialog>
    <SButton>Open Dialog</SButton>
  </SDialog>
</template>

✨ Features

  • shadcn-like design: Modern, clean aesthetic inspired by shadcn/ui.
  • Accessible: Built on @soybeanjs/headless primitives with full WAI-ARIA support.
  • RTL ready: Switch between LTR and RTL layouts with ConfigProvider.
  • Customizable at every level: Override individual slot classes via the ui prop, or swap the entire style layer.
  • Theme system: 8 semantic colors and 6 sizes, controlled via ConfigProvider.
  • Lightweight & Tree-shakable: Import only the components you use.
  • Type Safe: Fully typed in strict TypeScript.
  • Nuxt ready: First-class Nuxt module with auto-registration.
  • unplugin support: Auto-import resolver for unplugin-vue-components.

🎨 Theme System

Theme Colors

ColorTokenUsage
PrimaryprimaryPrimary actions, active states
DestructivedestructiveDelete, error, danger actions
SuccesssuccessConfirm, positive status
WarningwarningCaution, pending status
InfoinfoInformation, hints
CarboncarbonNeutral backgrounds, surfaces
SecondarysecondarySecondary actions, muted elements
AccentaccentHighlights, badges

Theme Sizes

SizeBase (rem)Pixel equivalent
xs0.7512px
sm0.87514px
md116px (default)
lg1.12518px
xl1.2520px
2xl1.524px
<script setup>
import { SConfigProvider, SButton } from '@soybeanjs/ui';
</script>

<template>
  <SConfigProvider :theme="{ color: 'primary', size: 'md' }">
    <SButton>Click me</SButton>
  </SConfigProvider>
</template>

🌐 Locale Support

@soybeanjs/ui inherits locale support from @soybeanjs/headless via ConfigProvider:

CodeLanguage
zh-CNSimplified Chinese
zh-TWTraditional Chinese
enEnglish
arArabic
jaJapanese
koKorean
deGerman
frFrench
esSpanish
pt-BRPortuguese (Brazil)
ruRussian
trTurkish
idIndonesian
<template>
  <SConfigProvider :locale="zhCN">
    <App />
  </SConfigProvider>
</template>

📚 Package Structure

packages/ui/src/
├── components/    # 86 styled component dirs (SButton, SDialog, SSelect…)
├── styles/        # UnoCSS style recipes and layer definitions
├── theme/         # Theme tokens, color scales, and size mappings
├── constants/     # Component and theme constants
├── nuxt/          # Nuxt module entry
├── resolver/      # unplugin-vue-components resolver
└── index.ts       # Main barrel export

Package Exports

import { SButton, SAccordion } from '@soybeanjs/ui'; // all components
import '@soybeanjs/ui/styles.css'; // pre-built UnoCSS stylesheet
// Also: @soybeanjs/ui/nuxt · @soybeanjs/ui/resolver

🧩 Components

@soybeanjs/ui ships 86 S-prefixed styled components, each wrapping a @soybeanjs/headless primitive:

CategoryComponents
LayoutSAccordion, SCard, SDialog, SDrawer, SPopover, STooltip
FormSButton, SCheckbox, SInput, SSelect, SSwitch, STextarea
NavigationSBreadcrumb, SPagination, SStepper, STabs
DataSTable, SDataList, STree
FeedbackSAlert, SBadge, SToast, SProgress
TypographySHeading, SText, SCode, SKbd
Date & TimeSCalendar, SDatePicker, STimePicker
MediaSAvatar, SCarousel, SImage

🔧 Customizing Components

Override individual slot classes via the ui prop:

<template>
  <SAccordion :ui="{ trigger: 'bg-blue-100 hover:bg-blue-200 rounded-lg' }">
    <SAccordionItem value="item-1">
      <SAccordionTrigger>Custom styled trigger</SAccordionTrigger>
      <SAccordionContent>Content here</SAccordionContent>
    </SAccordionItem>
  </SAccordion>
</template>

📖 Documentation

For full documentation, playground examples, and component API references, visit the SoybeanUI docs site.

💝 Credits

FAQs

Package last updated on 22 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts