Component Showcase
Component Showcase
Section titled “Component Showcase”Visual demonstration of all Supabase-quality UI components available in Varity docs.
1. CodeBlock Component
Section titled “1. CodeBlock Component”Enhanced code blocks with copy buttons and file names.
import { db } from '@varity-labs/sdk'
// Query data from a collection
const result = await db.collection('documents').get()
if (!result.success) {
console.error('Error:', result.error)
} else {
console.log('Documents:', result.data)
} 2. Callout Component
Section titled “2. Callout Component”Four semantic types for different message priorities.
Use environment variables for all API keys and sensitive configuration. Never commit credentials to Git.
The default RPC endpoint is https://rpc-varity-testnet.t.conduit.xyz.
You can override this in your Varity SDK configuration.
The SDK now uses a modular pattern. Use db for database operations
and standalone functions for credentials instead of a client instance.
Never expose your service role key in client-side code. This key has full access to your Varity project and should only be used in server environments.
Collapsible Callout
Section titled “Collapsible Callout”Advanced usage
You can pass additional options to customize the database:
import { Database } from '@varity-labs/sdk'
const customDb = new Database({ proxyUrl: 'https://your-proxy.example.com', appToken: 'your-app-token',})See the SDK Overview for all options.
3. Tabs Component
Section titled “3. Tabs Component”Multi-language code examples with keyboard navigation.
4. StepHikeCompact Component
Section titled “4. StepHikeCompact Component”Perfect for quickstart guides with 5-6 numbered steps.
Create a Varity account
Go to developer.store.varity.so and sign up for free. No credit card required.
Install the Varity CLI
Install varitykit globally using pip.
pip install varitykitInitialize your project
Run the init command to set up your project structure and configuration.
varitykit init my-appcd my-appDeploy to Varity
Deploy your app with a single command. Your app will be live in under 2 minutes.
varitykit app deployView your live app
Varity will output your deployment URL. Your app is now live on the Varity platform!
✓ Deployed: https://my-app.varity.app✓ Build time: 1m 23s✓ See pricing at varity.so5. Card Component
Section titled “5. Card Component”Feature showcases and navigation grids.
Basic Cards
Section titled “Basic Cards”End-to-End Encryption
Your data is encrypted at rest and in transit with zero-knowledge architecture.
Learn moreLightning Fast
Deploy apps in under 2 minutes with automatic scaling and optimization.
Learn more70% Cheaper
Save thousands compared to AWS with transparent, usage-based pricing.
Learn moreTwo Column Grid
Section titled “Two Column Grid”UI Components
42+ pre-built React components with seamless integration out of the box.
Learn moreDeveloper Tools
CLI, SDK, and browser extensions for seamless development workflow.
Learn more6. Accordion Component
Section titled “6. Accordion Component”Collapsible content for advanced/optional sections.
Default Variant
Section titled “Default Variant”What is Varity L3?
Varity L3 is the infrastructure layer that powers Varity applications. It provides:
- Free operations for users (sponsored by developers)
- Sub-second finality for fast responses
- Full compatibility with existing development tools
- Native USDC as the payment token
Chain ID: 33529
RPC: https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz
Advanced Variant (Layer 2 Content)
Section titled “Advanced Variant (Layer 2 Content)”Advanced: How smart accounts work
Varity uses ERC-4337 Account Abstraction for smart accounts. When you create an account:
- Factory creates a new smart account at a deterministic address
- Session keys enable free operations for specific actions
- Paymaster (
0x579772Bfa5Ec1e8f33B81F304ffDbC55135db154) sponsors usage fees - User operations are bundled and executed efficiently
Smart accounts are created automatically when a user signs in.
Varity handles all the complexity behind the scenes — developers just use
the usePrivy hook from @varity-labs/ui-kit.
Example Variant
Section titled “Example Variant”Example: Complete authentication flow
Here’s a complete example showing login, user state, and logout:
import { PrivyStack, PrivyLoginButton, usePrivy } from '@varity-labs/ui-kit'
// Set up auth providerfunction App() { return ( <PrivyStack appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID}> <AuthExample /> </PrivyStack> )}
// Use the auth hook for statefunction AuthExample() { const { ready, authenticated, user, logout } = usePrivy()
if (!ready) return <p>Loading...</p>
if (!authenticated) { return <PrivyLoginButton /> }
return ( <div> <p>Logged in as: {user?.email?.address}</p> <button onClick={logout}>Log out</button> </div> )}Utility Classes
Section titled “Utility Classes”Badges
Section titled “Badges”Status Indicators
Section titled “Status Indicators”API Documentation Card
Section titled “API Documentation Card”db.collection(name).get()asyncQuery all documents in a collection. Returns a CollectionResponse with success status and data.
Combining Components
Section titled “Combining Components”Here’s how components work together in a real docs page:
This example shows the recommended pattern for quickstart pages.
Advanced: Custom database configuration
For production deployments, you may want to customize the database configuration:
import { Database } from '@varity-labs/sdk'
const customDb = new Database({ proxyUrl: 'https://your-proxy.example.com', appToken: 'your-app-token',})
// Use the custom database instanceconst users = customDb.collection('users')const result = await users.get({ limit: 10 })