Site header
A sticky website header that turns solid on scroll, with a gliding active link, mega menu panels, and a mobile sheet.
An email signup framed by a stack of past issues; subscribing drops the next issue, addressed to you, onto the front.
npx shadcn@latest add @silicon-ui/newsletter-signupnpx shadcn@latest add @silicon-ui/newsletter-signupInstall the dependencies.
npm install @radix-ui/react-switch lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/blocks/newsletter-signup/newsletter-signup.tsxcomponents/silicon-ui/blocks/newsletter-signup/newsletter-signup-data.tscomponents/silicon-ui/lib/media.ts sharedcomponents/silicon-ui/blocks/newsletter-signup/newsletter-signup.module.csscomponents/silicon-ui/switch/switch.tsx sharedcomponents/silicon-ui/switch/switch.module.css sharedcomponents/silicon-ui/segmented-control/segmented-control.tsx sharedcomponents/silicon-ui/segmented-control/segmented-control.module.css sharedcomponents/silicon-ui/animated-counter/animated-counter.tsx sharedcomponents/silicon-ui/animated-counter/animated-counter.module.css sharedInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
NewsletterSignup| Prop | Type | Default |
|---|---|---|
variant`inline` puts the copy and form beside the issue stack; `card` is a self-contained card with the stack in a tray on top. | NewsletterVariant
| "inline" |
title | string | — |
description | string | — |
placeholder | string | "you@company.com" |
buttonLabel | string | "Subscribe" |
privacyNoteShort line under the form about frequency and privacy. | ReactNode | newsletterCopy.privacy |
privacyLinkLink after the privacy note. Pass null to hide it. | { label: string; href: string } | null | newsletterCopy.privacyLink |
readersReader count and up to three faces. The count ticks up by one when someone subscribes. Pass null to hide it. | { count: number; faces: string[] } | null | newsletterReaders |
publicationThe issue stack. On success the upcoming issue, addressed to the new reader, lands on top. Pass null for a form without the stack. | NewsletterPublication | null | newsletterPublication |
onSubscribeCalled with a valid, trimmed email. Reject to show an error and keep the email; resolve to show the success state. | (email: string) => void | Promise<void> | — |
className | string | — |
Also accepts the props of HTMLAttributes.