Skip to content

@varity-labs/ui-kit Overview

Varity Team Core Contributors Updated March 2026

A React component library that handles authentication, payments, and account management so you can focus on building your application.

  • Authentication: Email, Google, Twitter, Discord, and GitHub login with no extra prompts
  • Payments: Accept payments through the App Store and in-app widgets
  • Account Management: Automatic account creation and session handling
  • Free Operations: Users never pay usage fees
Terminal window
npm install @varity-labs/ui-kit @varity-labs/sdk
import { PrivyStack, PrivyLoginButton } from '@varity-labs/ui-kit';
function App() {
return (
<PrivyStack>
<PrivyLoginButton />
<YourApp />
</PrivyStack>
);
}

That’s it. Users can now sign in with email or social accounts.

PrivyStack

All-in-one provider that sets up authentication and account management. Wrap your app with this once.

PrivyLoginButton

Pre-built login button that opens the authentication modal. Supports email, Google, Twitter, Discord, and more.

PaymentWidget

Payment widget for in-app purchases and upgrades (post-beta).

PrivyProtectedRoute

Wrapper that shows content only to authenticated users. Shows login prompt otherwise.

  1. User clicks “Sign In”
  2. Modal appears with email and social options
  3. User enters email (receives code) or clicks social login
  4. Account is created automatically
  5. User is authenticated and ready to use your app
import { usePrivy } from '@varity-labs/ui-kit';
function Dashboard() {
const { authenticated, user, logout } = usePrivy();
if (!authenticated) {
return <PrivyLoginButton />;
}
return (
<div>
<p>Welcome, {user?.email?.address || 'User'}</p>
<button onClick={logout}>Sign Out</button>
</div>
);
}

When a user signs in with email or social login:

Behind the ScenesWhat User Sees
Account created”Signed in successfully”
Account linked to profileUser profile with email
Ready for operationsCan use your app immediately

Users never see technical details or extra prompts unless you choose to show them.

ExportDescription
PrivyStackAll-in-one provider (recommended)
VarityPrivyProviderAuthentication provider with Wagmi
VarityDashboardProviderDashboard-specific provider setup
ExportDescription
PrivyLoginButtonLogin button with modal
PrivyUserProfileDisplay user info with logout
PrivyProtectedRouteAuth-gated content wrapper
PrivyReadyGateLoading state during initialization
PaymentWidgetIn-app payment widget (post-beta)
PaymentGateSubscription/tier gate (post-beta)
ExportDescription
usePrivyCore authentication hook (re-exported)
useLoginTrigger login programmatically
useLogoutTrigger logout programmatically
Advanced: Additional Exports

These exports provide lower-level access for advanced use cases. All are currently exported and available.

ExportDescription
useWalletsAccess all connected accounts (re-exported)
useToastShow toast notifications (success, error, info)
useThemeAccess current theme and presets from ThemeProvider
useVarityPaymentPayment state and actions for in-app purchases
ExportDescription
DashboardLayoutFull dashboard layout with sidebar, header, footer
DashboardHeaderDashboard header bar
DashboardSidebarSidebar navigation
KPICardKey metric display card
StatusBadgeStatus indicator badge
EmptyStateEmpty state placeholder with presets
LoadingSkeletonLoading skeleton variants (text, card, table, list)
ExportDescription
DataTableSortable, paginated data table
AnalyticsCardAnalytics display card
ChartContainerChart wrapper with actions
MetricDisplayMetric with trend indicator
SparklineInline sparkline chart
ExportDescription
ThemeProviderTheme context provider with presets
LogoVarity logo component
AttributionRequired “Powered by Varity” attribution
import {
PrivyStack,
PrivyLoginButton,
PrivyUserProfile,
PrivyProtectedRoute,
usePrivy,
} from '@varity-labs/ui-kit';
function App() {
return (
<PrivyStack
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID}
loginMethods={['email', 'google']}
appearance={{
theme: 'light',
accentColor: '#2563EB',
logo: '/logo.png',
}}
>
<Layout>
<Header />
<PrivyProtectedRoute>
<Dashboard />
</PrivyProtectedRoute>
</Layout>
</PrivyStack>
);
}
function Header() {
const { authenticated } = usePrivy();
return (
<header>
{authenticated ? (
<PrivyUserProfile showLogoutButton />
) : (
<PrivyLoginButton>Sign In</PrivyLoginButton>
)}
</header>
);
}