ข้ามไปยังเนื้อหา
Yuva subscribe formเมนู

Yuva subscribe form

A mailing list sign-up form: e-mail, optional name, a checkbox per list, an unticked consent box whose sentence is stored as shown, and a switch per list for signed-in users.

ตัวอย่างทำงานด้วยข้อมูลตัวอย่าง ไม่ต้องใช้เครือข่ายหรือช่องทาง

การติดตั้ง

รันคำสั่งนี้ในโปรเจกต์ shadcn ไฟล์จะถูกคัดลอกไปเป็นโค้ดของคุณเอง

Shell
npx shadcn@latest add https://useyuva.com/r/yuva-subscribe.json

การใช้งาน

tsx
import { YuvaSubscribe } from "@/components/yuva-subscribe"

<YuvaSubscribe server={server} channel={channel} />

Props

YuvaSubscribeProps

Propชนิด
server?string
channel?string
client?YuvaClient
identityToken?IdentityTokenSource | null
lists?string[]
layout?"stacked" | "inline"
name?"off" | "optional" | "required"
consent?string
privacyUrl?string
locale?string
labels?Partial<YuvaSubscribeLabels>
onSubscribe?(detail: { lists: string[]; confirmation: boolean }) => void
className?string

ป้ายข้อความ

ป้ายข้อความทุกอันมีค่าเริ่มต้นเป็นภาษาอังกฤษ ส่งอ็อบเจ็กต์ labels บางส่วนเพื่อเปลี่ยนหรือแปล

ป้ายข้อความค่าเริ่มต้น
lists"Lists"
email"E-mail address"
name"Your name"
nameOptional"Your name (optional)"
button"Subscribe"
sending"Subscribing…"
consent(lists, inbox) => `I want to receive e-mails about ${lists} from ${inbox}. I can unsubscribe at any time.`
privacy"Privacy policy"
checkInbox"Almost done. Check your inbox and confirm your subscription."
subscribed"Thanks! You are subscribed."
pending"Check your inbox to confirm."
chooseList"Choose at least one list."
invalidEmail"Enter a valid e-mail address."
nameRequired"Enter your name."
consentRequired"Tick the box to agree."
noEmail"Your account has no e-mail address yet."
rateLimited"Too many attempts. Wait a moment and try again."
offline"You seem to be offline."
generic"Could not subscribe. Try again."

ส่วนที่ต้องพึ่งพา

การติดตั้งรายการนี้จะเพิ่มรายการต่อไปนี้ด้วย

คอมโพเนนต์จาก shadcn/ui

รายการ Yuva อื่น ๆ

แพ็กเกจ npm