Pieces/Code(17)

Code pieces from Beste UI, drop-in widgets built with shadcn/ui and Tailwind CSS.

Tools
list_pages
update_section
create_page
publish
npx shadcn@latest add https://beste.dev/r/hero181.json
components/hero181.tsx
components/ui/button.tsx
checkout.test.tsRunning
  • renders cart summary
  • applies coupon code
  • calculates shipping
  • charges saved card
pricing.ts
export function total(cart: Cart) {
const sum = cart.lines.reduce(add, 0)
return sum
const discount = coupon(cart, sum)
return sum - discount
}
members.ts
import { Sirius } from '@sirius/sdk'
const client = new Sirius(apiKey)
await client.members.create({ name })
# Database
DATABASE_URL=postgres://localhost/beste
REDIS_URL=redis://localhost:6379
PORT=3000
curl-XPOSThttps://api.beste.co/v1/users
-H"Content-Type: application/json"
-d'{"name": "Nils Frahm"}'
SELECT id, name, email
FROM users
WHERE active = true
ORDER BY created_at DESC
LIMIT 10;
TypeError: Cannot read 'name' of undefined
greet(src/utils.ts:14:12)
handler(src/server.ts:42:8)
processRequest(src/api.ts:88:4)
Open command palette
⌘K
{
"name":"Beste",
"active":true,
"count":42
}
import{useState, useEffect}from"react";
import{Button}from"@/ui/button";
import{cn}from"@/lib/utils";
const user = await fetchUser("42");
function greet(name) {
return 'Hi ' + name;
return `Hello, ${name}!`;
}
bun add @beste/ui
greet.ts
export function greet(name: string) {
return `Hello, ${name}!`;
}
 
console.log(greet("Beste"));
const greeting = "Hello, Beste!";ts
Markdown version