Billing Invoice Email Settings
A settings panel for how billing emails get delivered: which notifications go out, an optional CC address for a finance inbox, and a save button that confirms once changes are stored. One toggle can be marked locked to represent a notification that's always on, like a mandatory payment confirmation. Built for account settings pages in multi-user or enterprise billing portals.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, input, label dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-invoice-email-settings.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing68.tsx instead.
Usage
The file also exports billing68Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing68, billing68Demo } from "@/components/blocks/billing/billing68"; export default function Page() { return <Billing68 {...billing68Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Invoice email settings" | Heading shown at the top of the panel. |
| description | string | none | Optional supporting text under the heading. |
| primaryEmail | string | none | The account's default billing email, shown as read-only context above the toggles. |
| toggles | EmailSettingToggle[] | none | Each notification setting rendered as its own switch row. |
| defaultEnabledIds | string[] | [] | Which toggle ids start enabled on first render. |
| ccLabel | string | "Also send to (CC)" | Label above the CC email input. |
| ccPlaceholder | string | "finance@company.com" | Placeholder text in the CC email input. |
| defaultCcEmail | string | "" | Initial value of the CC email input. |
| saveLabel | string | "Save changes" | Label on the save button when idle. |
| className | string | none | Extra classes for the outer container. |
Types
interface EmailSettingToggle { id: string; label: string; description?: string; locked?: boolean; }
Behavior notes
- Toggle state, the CC email value, and the save status are all local component state; nothing here calls an API on its own.
- A toggle marked locked renders disabled and can't be switched off, for a notification you want to represent as always-on, like a mandatory payment confirmation.
- Changing any toggle or the CC field resets the save button back to its idle label, so a stale 'Saved' state never lingers after a new edit.
- Clicking save runs a 700ms local 'Saving' state, then shows 'Saved' with a checkmark for 2.5 seconds before returning to idle. There's no real persistence, wire the click handler to your own save endpoint.
- Every switch is a real button with role=switch and aria-checked rather than a native checkbox input.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.