முன்னோட்டம் மாதிரித் தரவில் இயங்குகிறது. நெட்வொர்க்கோ சேனலோ தேவையில்லை.
tsx
import { YuvaSubscribe } from "@/components/yuva-subscribe"
export function Newsletter() {
return (
<YuvaSubscribe
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL}
name="optional"
privacyUrl="/privacy"
/>
)
}நிறுவல்
இதை ஒரு shadcn திட்டத்தில் இயக்குங்கள். கோப்புகள் உங்கள் சொந்தக் குறியீட்டில் நகலெடுக்கப்படும்.
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonShell
bunx --bun 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." |
சார்புகள்
இந்த உருப்படியை நிறுவினால் கீழுள்ளவையும் சேர்க்கப்படும்.