Staaarter

Notification Channel Picker

A centered set of notification-channel cards, each with an icon, label, and short description, that visitors can tap to choose how they'd like to be notified at launch. Selecting a card toggles a real, per-card selected state and updates a running selected-count badge below the grid.

By Staaarter Team
Coming Soon
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/notification-channel-picker.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/coming-soon/comingsoon11.tsx instead.

Usage

The file also exports comingsoon11Demo, 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 { ComingSoon11, comingsoon11Demo } from "@/components/blocks/coming-soon/comingsoon11";

export default function Page() {
  return <ComingSoon11 {...comingsoon11Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstring"Coming soon"Small label above the heading.
headingstring"Choose how we notify you"Section heading.
descriptionstring"Pick the channels you'd like to hear from us on..."Section subheading.
channelsNotificationChannel[]noneChannel cards to render, in display order (icon is assigned by position, not by data).
defaultSelectedstring[][]Channel ids selected on initial render.
classNamestringnoneExtra classes for the outer section element.

Types

export interface NotificationChannel {
  id: string;
  label: string;
  description: string;
}

Behavior notes

  • `"use client"`. Clicking a card is real interactivity: it toggles that channel's id in a `useState<Set<string>>`, updates the card's selected styling and `aria-pressed`, and the "N channels selected" badge below recomputes from that same state.
  • Each card's icon is picked from a fixed, hardcoded array by array position (Mail/MessageSquare/AtSign/Smartphone), not passed in per-item as a prop, since a component reference can't cross the client-component boundary.
  • No data is actually submitted anywhere; this only tracks in-memory selection for the demo.