Design se code tak
Where thoughtful design meets production-ready code. I design and build digital experiences that look great and work beautifully.
toggle-01
import {
Bookmark as BookmarkIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function ToggleDemo() {
return (
<Toggle aria-label="Toggle bookmark" size="sm" variant="outline">
<BookmarkIcon className="group-aria-pressed/toggle:fill-foreground" />
Bookmark
</Toggle>
)
}toggle-02
import {
Bold as BoldIcon,
Italic as ItalicIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function ToggleOutline() {
return (
<div className="flex flex-wrap items-center gap-2">
<Toggle variant="outline" aria-label="Toggle italic">
<ItalicIcon />
Italic
</Toggle>
<Toggle variant="outline" aria-label="Toggle bold">
<BoldIcon />
Bold
</Toggle>
</div>
)
}toggle-03
import {
Star as StarIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const sizes = ["sm", "default", "lg"] as const
export function ToggleSizeScale() {
return (
<div className="flex flex-wrap items-end justify-center gap-3">
{sizes.map((size) => (
<div key={size} className="flex flex-col items-center gap-2">
<Toggle size={size} variant="outline" aria-label={"Star, " + size}>
<StarIcon className="group-aria-pressed/toggle:fill-current" />
Star
</Toggle>
<span className="text-xs text-muted-foreground">{size}</span>
</div>
))}
</div>
)
}
toggle-04
import {
Pin as PinIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function ToggleVariantStates() {
return (
<div className="grid w-full max-w-xs grid-cols-[auto_1fr_1fr] items-center gap-3 text-xs">
<span />
<span className="text-center text-muted-foreground">Off</span>
<span className="text-center text-muted-foreground">On</span>
<span className="text-muted-foreground">default</span>
<Toggle aria-label="Pin (off)" className="justify-self-center">
<PinIcon />
</Toggle>
<Toggle
aria-label="Pin (on)"
defaultPressed
className="justify-self-center"
>
<PinIcon />
</Toggle>
<span className="text-muted-foreground">outline</span>
<Toggle
variant="outline"
aria-label="Pin outline (off)"
className="justify-self-center"
>
<PinIcon />
</Toggle>
<Toggle
variant="outline"
aria-label="Pin outline (on)"
defaultPressed
className="justify-self-center"
>
<PinIcon />
</Toggle>
</div>
)
}
toggle-05
import {
Bell as BellIcon,
Cloud as CloudIcon,
RefreshCw as RefreshCwIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function DisabledToggleStates() {
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex flex-wrap gap-2">
<Toggle variant="outline" aria-label="Notifications">
<BellIcon />
Alerts
</Toggle>
<Toggle variant="outline" disabled aria-label="Sync">
<RefreshCwIcon />
Sync
</Toggle>
<Toggle variant="outline" disabled defaultPressed aria-label="Backup">
<CloudIcon />
Backup
</Toggle>
</div>
<p className="text-xs text-muted-foreground">
Sync and Backup are managed by your Designali studio admin.
</p>
</div>
)
}
toggle-06
"use client"
import * as React from "react"
import {
Bell as BellIcon,
BellOff as BellOffIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
export function ControlledToggleStatus() {
const [pressed, setPressed] = React.useState(false)
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex items-center justify-between">
<Toggle
variant="outline"
pressed={pressed}
onPressedChange={setPressed}
aria-label="Do not disturb"
>
{pressed ? <BellOffIcon /> : <BellIcon />}
Do not disturb
</Toggle>
<Badge variant={pressed ? "default" : "secondary"}>
{pressed ? "On" : "Off"}
</Badge>
</div>
<div className="flex gap-2">
<Button
size="sm"
variant="outline"
className="flex-1"
onClick={() => setPressed(true)}
>
Turn on
</Button>
<Button
size="sm"
variant="outline"
className="flex-1"
onClick={() => setPressed(false)}
>
Turn off
</Button>
</div>
</div>
)
}
toggle-07
"use client"
import * as React from "react"
import {
Heart as HeartIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function FavoriteHeartToggle() {
const [liked, setLiked] = React.useState(false)
const count = 128 + (liked ? 1 : 0)
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<p className="text-sm">
New on designali.com: 4000+ icons in @designali/icons.
</p>
<div className="flex items-center gap-2">
<Toggle
pressed={liked}
onPressedChange={setLiked}
aria-label="Like post"
className="aria-pressed:text-primary"
>
<HeartIcon className="group-aria-pressed/toggle:fill-current" />
<span className="tabular-nums">{count}</span>
</Toggle>
<span className="text-xs text-muted-foreground">
{liked ? "You and 128 others" : "128 likes"}
</span>
</div>
</div>
)
}
toggle-08
"use client"
import * as React from "react"
import {
Star as StarIcon,
} from "@designali/icons"
import {
ButtonGroup,
ButtonGroupText,
} from "@/components/ui/button-group"
import { Toggle } from "@/components/ui/toggle"
export function StarRepositoryToggle() {
const [starred, setStarred] = React.useState(false)
return (
<div className="flex w-full max-w-sm items-center justify-between gap-3 border p-4">
<div className="min-w-0">
<p className="truncate font-sans text-sm">designali/icons</p>
<p className="text-xs text-muted-foreground">
4000+ React icons from Designali
</p>
</div>
<ButtonGroup>
<Toggle
variant="outline"
size="sm"
pressed={starred}
onPressedChange={setStarred}
aria-label="Star repository"
>
<StarIcon className="group-aria-pressed/toggle:fill-primary group-aria-pressed/toggle:text-primary" />
{starred ? "Starred" : "Star"}
</Toggle>
<ButtonGroupText className="h-7 text-xs tabular-nums">
{starred ? "2.4k" : "2.3k"}
</ButtonGroupText>
</ButtonGroup>
</div>
)
}
toggle-09
"use client"
import * as React from "react"
import {
Mic as MicIcon,
MicOff as MicOffIcon,
} from "@designali/icons"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Toggle } from "@/components/ui/toggle"
export function MicrophoneMuteToggle() {
const [muted, setMuted] = React.useState(false)
return (
<div className="flex w-full max-w-xs flex-col items-center gap-3 border bg-muted/30 p-6">
<Avatar size="lg">
<AvatarFallback>DK</AvatarFallback>
</Avatar>
<p className="text-sm font-medium">Dana Kim (you)</p>
<Toggle
variant="outline"
size="lg"
pressed={muted}
onPressedChange={setMuted}
aria-label={muted ? "Unmute microphone" : "Mute microphone"}
className="aria-pressed:border-destructive aria-pressed:bg-destructive/10 aria-pressed:text-destructive"
>
{muted ? <MicOffIcon /> : <MicIcon />}
{muted ? "Muted" : "Mic on"}
</Toggle>
</div>
)
}
toggle-10
import {
Captions as CaptionsIcon,
Hand as HandIcon,
MonitorUp as MonitorUpIcon,
PhoneOff as PhoneOffIcon,
Video as VideoIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Separator } from "@/components/ui/separator"
import { Toggle } from "@/components/ui/toggle"
const controls = [
{ id: "camera", label: "Camera", icon: VideoIcon, on: true },
{ id: "share", label: "Share screen", icon: MonitorUpIcon, on: false },
{ id: "captions", label: "Captions", icon: CaptionsIcon, on: false },
{ id: "hand", label: "Raise hand", icon: HandIcon, on: false },
]
export function CallControlBar() {
return (
<div className="flex items-center gap-1 border bg-background p-1.5 shadow-sm">
{controls.map((c) => (
<Toggle
key={c.id}
size="lg"
defaultPressed={c.on}
aria-label={c.label}
title={c.label}
>
<c.icon />
</Toggle>
))}
<Separator orientation="vertical" className="mx-1 h-6" />
<Button variant="destructive" size="icon-lg" aria-label="Leave call">
<PhoneOffIcon />
</Button>
</div>
)
}
toggle-11
"use client"
import * as React from "react"
import {
Pin as PinIcon,
PinOff as PinOffIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const initialNotes = [
{
id: 1,
title: "Client kickoff",
body: "Brand identity brief, moodboard, timeline",
pinned: false,
},
{
id: 2,
title: "Release checklist",
body: "Ship 20 new blocks to designali.com/blocks",
pinned: true,
},
{
id: 3,
title: "Icon set review",
body: "Review @designali/icons additions by Friday",
pinned: false,
},
]
export function PinnedNotesToggle() {
const [notes, setNotes] = React.useState(initialNotes)
const sorted = [...notes].sort((a, b) => Number(b.pinned) - Number(a.pinned))
return (
<div className="flex w-full max-w-sm flex-col gap-2">
{sorted.map((n) => (
<div key={n.id} className="flex items-start gap-3 border p-3">
<div className="min-w-0 flex-1">
<p className="text-sm font-medium">{n.title}</p>
<p className="truncate text-xs text-muted-foreground">{n.body}</p>
</div>
<Toggle
size="sm"
pressed={n.pinned}
onPressedChange={(pinned) =>
setNotes((prev) =>
prev.map((x) => (x.id === n.id ? { ...x, pinned } : x))
)
}
aria-label={n.pinned ? "Unpin note" : "Pin note"}
>
{n.pinned ? <PinIcon className="fill-current" /> : <PinOffIcon />}
</Toggle>
</div>
))}
</div>
)
}
toggle-12
"use client"
import * as React from "react"
import {
UserCheck as UserCheckIcon,
UserPlus as UserPlusIcon,
} from "@designali/icons"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Toggle } from "@/components/ui/toggle"
export function FollowToggleButton() {
const [following, setFollowing] = React.useState(false)
return (
<div className="flex w-full max-w-xs items-center gap-3 border p-4">
<Avatar>
<AvatarFallback>AI</AvatarFallback>
</Avatar>
<div className="min-w-0 flex-1">
<p className="text-sm font-medium">Ali Imam</p>
<p className="truncate text-xs text-muted-foreground">
Design engineer at Designali
</p>
</div>
<Toggle
variant="outline"
size="sm"
pressed={following}
onPressedChange={setFollowing}
aria-label="Follow Ali Imam"
>
{following ? <UserCheckIcon /> : <UserPlusIcon />}
{following ? "Following" : "Follow"}
</Toggle>
</div>
)
}
toggle-13
import {
Heart as HeartIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function WishlistProductToggle() {
return (
<div className="w-full max-w-[240px] border">
<div className="relative aspect-square bg-gradient-to-br from-primary/20 to-primary dark:from-chart-4 dark:to-chart-5">
<Toggle
size="sm"
aria-label="Add to wishlist"
className="absolute end-2 top-2 bg-background/80 backdrop-blur hover:bg-background aria-pressed:bg-background aria-pressed:text-primary"
>
<HeartIcon className="group-aria-pressed/toggle:fill-current" />
</Toggle>
</div>
<div className="p-3">
<p className="text-sm font-medium">Merino crew sweater</p>
<p className="text-sm text-muted-foreground">$89.00</p>
</div>
</div>
)
}
toggle-14
"use client"
import * as React from "react"
import {
BellOff as BellOffIcon,
BellRing as BellRingIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function ThreadSubscribeToggle() {
const [subscribed, setSubscribed] = React.useState(true)
return (
<div className="flex w-full max-w-sm flex-col gap-3 border p-4">
<div className="flex items-start justify-between gap-3">
<div>
<p className="text-sm font-medium">
Redesign the designali.com pricing page
</p>
<p className="text-xs text-muted-foreground">
DES-142 - 23 comments
</p>
</div>
<Toggle
variant="outline"
size="sm"
pressed={subscribed}
onPressedChange={setSubscribed}
aria-label="Subscribe to thread"
>
{subscribed ? <BellRingIcon /> : <BellOffIcon />}
{subscribed ? "Subscribed" : "Subscribe"}
</Toggle>
</div>
<p className="text-xs text-muted-foreground">
{subscribed
? "You will be notified about new replies."
: "You will only be notified when mentioned."}
</p>
</div>
)
}
toggle-15
"use client"
import * as React from "react"
import {
Eye as EyeIcon,
EyeOff as EyeOffIcon,
} from "@designali/icons"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Toggle } from "@/components/ui/toggle"
export function PasswordVisibilityToggle() {
const [visible, setVisible] = React.useState(false)
return (
<div className="flex w-full max-w-xs flex-col gap-2">
<Label htmlFor="pw">Password</Label>
<div className="relative">
<Input
id="pw"
type={visible ? "text" : "password"}
defaultValue="correct-horse-battery"
className="pe-10"
/>
<Toggle
size="sm"
pressed={visible}
onPressedChange={setVisible}
aria-label={visible ? "Hide password" : "Show password"}
className="absolute end-1 top-1/2 -translate-y-1/2 aria-pressed:bg-transparent"
>
{visible ? <EyeOffIcon /> : <EyeIcon />}
</Toggle>
</div>
</div>
)
}
toggle-16
"use client"
import * as React from "react"
import {
Award as AwardIcon,
Briefcase as BriefcaseIcon,
Globe as GlobeIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const jobs = [
{
title: "Senior UI/UX Designer",
remote: true,
fullTime: true,
senior: true,
},
{ title: "Next.js Developer", remote: true, fullTime: true, senior: false },
{ title: "Brand Identity Designer", remote: false, fullTime: false, senior: false },
{ title: "Motion & 3D Artist", remote: false, fullTime: true, senior: true },
]
export function FilterChipToggles() {
const [remote, setRemote] = React.useState(false)
const [fullTime, setFullTime] = React.useState(false)
const [senior, setSenior] = React.useState(false)
const results = jobs.filter(
(j) =>
(!remote || j.remote) &&
(!fullTime || j.fullTime) &&
(!senior || j.senior)
)
return (
<div className="flex w-full max-w-sm flex-col gap-3">
<div className="flex flex-wrap gap-2">
<Toggle
variant="outline"
size="sm"
pressed={remote}
onPressedChange={setRemote}
>
<GlobeIcon />
Remote
</Toggle>
<Toggle
variant="outline"
size="sm"
pressed={fullTime}
onPressedChange={setFullTime}
>
<BriefcaseIcon />
Full-time
</Toggle>
<Toggle
variant="outline"
size="sm"
pressed={senior}
onPressedChange={setSenior}
>
<AwardIcon />
Senior
</Toggle>
</div>
<div className="border">
{results.length ? (
results.map((j) => (
<p
key={j.title}
className="border-b px-3 py-2 text-sm last:border-b-0"
>
{j.title}
</p>
))
) : (
<p className="px-3 py-4 text-center text-sm text-muted-foreground">
No roles match these filters.
</p>
)}
</div>
</div>
)
}
toggle-17
"use client"
import * as React from "react"
import {
Pause as PauseIcon,
Play as PlayIcon,
Repeat1 as Repeat1Icon,
Shuffle as ShuffleIcon,
SkipBack as SkipBackIcon,
SkipForward as SkipForwardIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
export function MusicPlayerModeToggles() {
const [playing, setPlaying] = React.useState(false)
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex items-center gap-3">
<div className="size-12 shrink-0 bg-gradient-to-br from-primary to-primary" />
<div className="min-w-0">
<p className="truncate text-sm font-medium">Night Drive</p>
<p className="truncate text-xs text-muted-foreground">
The Paper Lanterns
</p>
</div>
</div>
<div className="flex items-center justify-between">
<Toggle
size="sm"
aria-label="Shuffle"
className="aria-pressed:text-primary"
>
<ShuffleIcon />
</Toggle>
<Button variant="ghost" size="icon-sm" aria-label="Previous">
<SkipBackIcon />
</Button>
<Toggle
variant="outline"
size="lg"
pressed={playing}
onPressedChange={setPlaying}
aria-label={playing ? "Pause" : "Play"}
>
{playing ? <PauseIcon /> : <PlayIcon />}
</Toggle>
<Button variant="ghost" size="icon-sm" aria-label="Next">
<SkipForwardIcon />
</Button>
<Toggle
size="sm"
aria-label="Repeat"
className="aria-pressed:text-primary"
>
<Repeat1Icon />
</Toggle>
</div>
</div>
)
}
toggle-18
"use client"
import * as React from "react"
import {
Bookmark as BookmarkIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const articles = [
{ id: "a", title: "Design se code tak: our workflow", mins: 6 },
{ id: "b", title: "Building blocks with Tailwind CSS", mins: 11 },
{ id: "c", title: "Using @designali/icons in Next.js", mins: 4 },
]
export function ArticleBookmarkToggles() {
const [saved, setSaved] = React.useState<string[]>(["b"])
return (
<div className="w-full max-w-sm border">
<div className="flex justify-between border-b bg-muted/40 px-3 py-2 text-xs text-muted-foreground">
<span>This week</span>
<span>{saved.length} saved</span>
</div>
{articles.map((a) => (
<div
key={a.id}
className="flex items-center gap-3 border-b px-3 py-2.5 last:border-b-0"
>
<div className="min-w-0 flex-1">
<p className="truncate text-sm">{a.title}</p>
<p className="text-xs text-muted-foreground">{a.mins} min read</p>
</div>
<Toggle
size="sm"
pressed={saved.includes(a.id)}
onPressedChange={(on) =>
setSaved((prev) =>
on ? [...prev, a.id] : prev.filter((x) => x !== a.id)
)
}
aria-label={"Bookmark " + a.title}
>
<BookmarkIcon className="group-aria-pressed/toggle:fill-current" />
</Toggle>
</div>
))}
</div>
)
}
toggle-19
"use client"
import * as React from "react"
import {
ListOrdered as ListOrderedIcon,
TextWrap as WrapTextIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
const lines = [
"export function formatPrice(cents: number, currency = 'EUR') {",
" return new Intl.NumberFormat('de-DE', { style: 'currency', currency }).format(cents / 100)",
"}",
]
export function CodeEditorViewToggles() {
const [wrap, setWrap] = React.useState(false)
const [numbers, setNumbers] = React.useState(true)
return (
<div className="w-full max-w-md border">
<div className="flex items-center gap-1 border-b px-2 py-1">
<span className="flex-1 font-sans text-xs text-muted-foreground">
price.ts
</span>
<Toggle
size="sm"
pressed={wrap}
onPressedChange={setWrap}
aria-label="Word wrap"
>
<WrapTextIcon />
</Toggle>
<Toggle
size="sm"
pressed={numbers}
onPressedChange={setNumbers}
aria-label="Line numbers"
>
<ListOrderedIcon />
</Toggle>
</div>
<pre
className={cn(
"overflow-x-auto p-3 font-sans text-xs leading-5",
wrap && "break-all whitespace-pre-wrap"
)}
>
{lines.map((line, i) => (
<div key={i} className="flex gap-3">
{numbers && (
<span className="w-4 shrink-0 text-end text-muted-foreground select-none">
{i + 1}
</span>
)}
<span>{line}</span>
</div>
))}
</pre>
</div>
)
}
toggle-20
"use client"
import * as React from "react"
import {
Eye as EyeIcon,
} from "@designali/icons"
import { Textarea } from "@/components/ui/textarea"
import { Toggle } from "@/components/ui/toggle"
export function MarkdownPreviewToggle() {
const [preview, setPreview] = React.useState(false)
const [text, setText] = React.useState(
"Looks great! Just one nit: rename **HeroBlock** to **DesignaliHero**."
)
return (
<div className="flex w-full max-w-sm flex-col border">
<div className="flex items-center justify-between border-b px-2 py-1">
<span className="px-1 text-xs font-medium">Comment</span>
<Toggle
size="sm"
pressed={preview}
onPressedChange={setPreview}
aria-label="Preview"
>
<EyeIcon />
Preview
</Toggle>
</div>
{preview ? (
<p className="min-h-24 p-3 text-sm">
{text
.split("**")
.map((part, i) => (i % 2 ? <strong key={i}>{part}</strong> : part))}
</p>
) : (
<Textarea
value={text}
onChange={(e) => setText(e.target.value)}
className="min-h-24 border-0 focus-visible:ring-0"
/>
)}
</div>
)
}
toggle-21
"use client"
import * as React from "react"
import {
Link2 as Link2Icon,
Link2Off as Link2OffIcon,
} from "@designali/icons"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Toggle } from "@/components/ui/toggle"
export function AspectRatioLockToggle() {
const [locked, setLocked] = React.useState(true)
const [size, setSize] = React.useState({ w: 1600, h: 900 })
const ratio = 16 / 9
return (
<div className="flex w-full max-w-xs items-end gap-2 border p-4">
<div className="flex flex-1 flex-col gap-1.5">
<Label htmlFor="w">Width</Label>
<Input
id="w"
type="number"
value={size.w}
onChange={(e) => {
const w = Number(e.target.value)
setSize((s) => ({ w, h: locked ? Math.round(w / ratio) : s.h }))
}}
/>
</div>
<Toggle
variant="outline"
pressed={locked}
onPressedChange={setLocked}
aria-label={locked ? "Unlock aspect ratio" : "Lock aspect ratio"}
className="h-10 min-w-10"
>
{locked ? <Link2Icon /> : <Link2OffIcon />}
</Toggle>
<div className="flex flex-1 flex-col gap-1.5">
<Label htmlFor="h">Height</Label>
<Input
id="h"
type="number"
value={size.h}
onChange={(e) => {
const h = Number(e.target.value)
setSize((s) => ({ h, w: locked ? Math.round(h * ratio) : s.w }))
}}
/>
</div>
</div>
)
}
toggle-22
"use client"
import * as React from "react"
import {
Grid3x3 as Grid3x3Icon,
Magnet as MagnetIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
import { DotPattern } from "@/components/ui/dot-pattern"
export function CanvasGridSnapToggles() {
const [grid, setGrid] = React.useState(true)
const [snap, setSnap] = React.useState(false)
return (
<div className="flex w-full max-w-sm flex-col border">
<div className="flex items-center gap-1 border-b p-1">
<Toggle size="sm" pressed={grid} onPressedChange={setGrid}>
<Grid3x3Icon />
Grid
</Toggle>
<Toggle
size="sm"
pressed={snap}
onPressedChange={setSnap}
disabled={!grid}
>
<MagnetIcon />
Snap
</Toggle>
</div>
<div className="relative h-40 bg-background">
{grid && (
<DotPattern
width={16}
height={16}
dotSize={1}
className="rounded-none p-0 text-muted-foreground"
/>
)}
<div
className={cn(
"absolute size-12 bg-primary/80",
snap ? "top-8 left-16" : "top-[37px] left-[69px]"
)}
/>
<div
className={cn(
"absolute h-8 w-20 border-2 border-primary",
snap ? "top-24 left-40" : "top-[101px] left-[163px]"
)}
/>
</div>
</div>
)
}
toggle-23
import {
Eye as EyeIcon,
EyeOff as EyeOffIcon,
Layers as LayersIcon,
Lock as LockIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const layers = [
{ name: "Header", visible: true, locked: false },
{ name: "Designali hero", visible: true, locked: true },
{ name: "Pricing table", visible: false, locked: false },
{ name: "Footer", visible: true, locked: false },
]
export function LayerVisibilityLockToggles() {
return (
<div className="w-full max-w-xs border">
<div className="border-b px-3 py-2 text-xs font-medium text-muted-foreground">
Layers
</div>
{layers.map((l) => (
<div
key={l.name}
className="flex items-center gap-1 border-b px-2 py-1 last:border-b-0"
>
<LayersIcon className="ms-1 size-3.5 text-muted-foreground" />
<span className="ms-1 flex-1 text-sm">{l.name}</span>
<Toggle
size="sm"
defaultPressed={l.visible}
aria-label={"Toggle visibility of " + l.name}
className="text-muted-foreground aria-pressed:bg-transparent aria-pressed:text-foreground"
>
<EyeOffIcon className="group-aria-pressed/toggle:hidden" />
<EyeIcon className="hidden group-aria-pressed/toggle:block" />
</Toggle>
<Toggle
size="sm"
defaultPressed={l.locked}
aria-label={"Lock " + l.name}
>
<LockIcon />
</Toggle>
</div>
))}
</div>
)
}
toggle-24
"use client"
import * as React from "react"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
import { CounterNumber } from "@/components/ui/counter-number"
export function LiveUpdatesToggle() {
const [live, setLive] = React.useState(true)
const [visitors, setVisitors] = React.useState(1284)
React.useEffect(() => {
if (!live) return
const id = setInterval(
() => setVisitors((v) => v + Math.round(Math.random() * 10 - 4)),
1000
)
return () => clearInterval(id)
}, [live])
return (
<div className="flex w-full max-w-xs flex-col gap-2 border p-4">
<div className="flex items-center justify-between">
<span className="text-xs font-medium text-muted-foreground">
designali.com visitors
</span>
<Toggle
size="sm"
variant="outline"
pressed={live}
onPressedChange={setLive}
aria-label="Live updates"
>
<span
className={cn(
"size-2 rounded-full",
live ? "animate-pulse bg-primary" : "bg-muted-foreground"
)}
/>
{live ? "Live" : "Paused"}
</Toggle>
</div>
<CounterNumber
value={visitors}
startValue={1284}
size="lg"
duration={600}
className="font-semibold tracking-normal"
/>
</div>
)
}
toggle-25
"use client"
import * as React from "react"
import {
Columns3 as Columns3Icon,
} from "@designali/icons"
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table"
import { Toggle } from "@/components/ui/toggle"
const rows = [
{ id: "INV-301", customer: "Brand identity", amount: "$1,240", due: "Oct 30" },
{ id: "INV-302", customer: "UI/UX design", amount: "$860", due: "Nov 04" },
{ id: "INV-303", customer: "Next.js website", amount: "$3,100", due: "Nov 12" },
]
export function TableColumnVisibilityToggles() {
const [showAmount, setShowAmount] = React.useState(true)
const [showDue, setShowDue] = React.useState(false)
return (
<div className="flex w-full max-w-md flex-col gap-2">
<div className="flex items-center gap-2 text-xs text-muted-foreground">
<Columns3Icon className="size-3.5" />
Columns
<Toggle
size="sm"
variant="outline"
pressed={showAmount}
onPressedChange={setShowAmount}
>
Amount
</Toggle>
<Toggle
size="sm"
variant="outline"
pressed={showDue}
onPressedChange={setShowDue}
>
Due date
</Toggle>
</div>
<Table>
<TableHeader>
<TableRow>
<TableHead>Invoice</TableHead>
<TableHead>Service</TableHead>
{showAmount && <TableHead className="text-end">Amount</TableHead>}
{showDue && <TableHead>Due</TableHead>}
</TableRow>
</TableHeader>
<TableBody>
{rows.map((r) => (
<TableRow key={r.id}>
<TableCell className="font-sans text-xs">{r.id}</TableCell>
<TableCell>{r.customer}</TableCell>
{showAmount && (
<TableCell className="text-end tabular-nums">
{r.amount}
</TableCell>
)}
{showDue && <TableCell>{r.due}</TableCell>}
</TableRow>
))}
</TableBody>
</Table>
</div>
)
}
toggle-26
import {
Car as CarIcon,
Coffee as CoffeeIcon,
Dumbbell as DumbbellIcon,
PawPrint as PawPrintIcon,
Waves as WavesIcon,
Wifi as WifiIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const amenities = [
{ label: "Wi-Fi", icon: WifiIcon },
{ label: "Parking", icon: CarIcon },
{ label: "Pool", icon: WavesIcon },
{ label: "Gym", icon: DumbbellIcon },
{ label: "Breakfast", icon: CoffeeIcon },
{ label: "Pets", icon: PawPrintIcon },
]
export function HotelAmenityToggles() {
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<p className="text-sm font-medium">Amenities</p>
<div className="grid grid-cols-3 gap-2">
{amenities.map((a) => (
<Toggle
key={a.label}
variant="outline"
className="h-auto flex-col gap-1.5 py-3"
>
<a.icon />
{a.label}
</Toggle>
))}
</div>
</div>
)
}
toggle-27
"use client"
import * as React from "react"
import {
Check as CheckIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
const topics = [
"Design",
"Startups",
"AI",
"Climate",
"Finance",
"Travel",
"Gaming",
"Music",
"Science",
]
export function InterestPickerToggles() {
const [picked, setPicked] = React.useState<string[]>([])
const remaining = Math.max(0, 3 - picked.length)
return (
<div className="flex w-full max-w-sm flex-col gap-4 border p-4">
<div>
<p className="text-sm font-medium">What are you into?</p>
<p className="text-xs text-muted-foreground">
Pick at least 3 topics to personalise your feed.
</p>
</div>
<div className="flex flex-wrap gap-2">
{topics.map((t) => (
<Toggle
key={t}
variant="outline"
size="sm"
pressed={picked.includes(t)}
onPressedChange={(on) =>
setPicked((prev) =>
on ? [...prev, t] : prev.filter((x) => x !== t)
)
}
className="aria-pressed:border-primary aria-pressed:bg-primary aria-pressed:text-primary-foreground"
>
{picked.includes(t) && <CheckIcon />}
{t}
</Toggle>
))}
</div>
<Button disabled={remaining > 0}>
{remaining > 0 ? "Pick " + remaining + " more" : "Continue"}
</Button>
</div>
)
}
toggle-28
"use client"
import * as React from "react"
import { Badge } from "@/components/ui/badge"
import { Toggle } from "@/components/ui/toggle"
export function AnnualBillingToggle() {
const [annual, setAnnual] = React.useState(false)
const price = annual ? 16 : 20
return (
<div className="flex w-full max-w-xs flex-col gap-4 border p-5">
<div className="flex items-center justify-between">
<span className="text-sm font-medium">Team plan</span>
<Toggle
variant="outline"
size="sm"
pressed={annual}
onPressedChange={setAnnual}
>
Pay yearly
<Badge variant={annual ? "default" : "secondary"} className="ms-1">
-20%
</Badge>
</Toggle>
</div>
<p>
<span className="text-3xl font-semibold">{"$" + price}</span>
<span className="text-sm text-muted-foreground"> / seat / month</span>
</p>
<p className="text-xs text-muted-foreground">
{annual
? "Billed $192 per seat each year."
: "Billed monthly. Cancel anytime."}
</p>
</div>
)
}
toggle-29
"use client"
import * as React from "react"
import {
GitCompare as GitCompareIcon,
Laptop as LaptopIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
const laptops = [
{ id: "air", name: "MacBook mockup", price: "$19" },
{ id: "pro", name: "iMac mockup", price: "$29" },
{ id: "max", name: "Studio Display mockup", price: "$39" },
]
export function ProductCompareToggle() {
const [compare, setCompare] = React.useState<string[]>([])
return (
<div className="flex w-full max-w-sm flex-col border">
{laptops.map((l) => (
<div
key={l.id}
className="flex items-center gap-3 border-b px-3 py-2.5"
>
<LaptopIcon className="size-5 text-muted-foreground" />
<div className="flex-1">
<p className="text-sm font-medium">{l.name}</p>
<p className="text-xs text-muted-foreground">{l.price}</p>
</div>
<Toggle
size="sm"
variant="outline"
pressed={compare.includes(l.id)}
onPressedChange={(on) =>
setCompare((prev) =>
on ? [...prev, l.id] : prev.filter((x) => x !== l.id)
)
}
>
<GitCompareIcon />
Compare
</Toggle>
</div>
))}
<div className="flex items-center justify-between bg-muted/40 px-3 py-2">
<span className="text-xs text-muted-foreground">
{compare.length} selected
</span>
<Button size="sm" disabled={compare.length < 2}>
Compare now
</Button>
</div>
</div>
)
}
toggle-30
"use client"
import * as React from "react"
import {
Captions as CaptionsIcon,
CirclePlay as PlayCircleIcon,
Settings as SettingsIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
export function VideoCaptionsToggle() {
const [captions, setCaptions] = React.useState(true)
return (
<div className="relative aspect-video w-full max-w-md overflow-hidden bg-gradient-to-br from-foreground to-foreground text-white">
<div className="absolute inset-0 flex items-center justify-center">
<PlayCircleIcon className="size-12 opacity-80" />
</div>
{captions && (
<p className="absolute inset-x-6 bottom-12 bg-black/70 px-2 py-1 text-center text-sm">
"Start by measuring the room twice, then cut once."
</p>
)}
<div className="absolute inset-x-0 bottom-0 flex items-center justify-end gap-1 bg-gradient-to-t from-black/70 p-2">
<Toggle
size="sm"
pressed={captions}
onPressedChange={setCaptions}
aria-label="Captions"
className="text-white hover:bg-white/15 hover:text-white aria-pressed:bg-white aria-pressed:text-black"
>
<CaptionsIcon />
</Toggle>
<Button
size="icon-sm"
variant="ghost"
aria-label="Settings"
className="text-white hover:bg-white/15 hover:text-white"
>
<SettingsIcon />
</Button>
</div>
</div>
)
}
toggle-31
"use client"
import * as React from "react"
import {
ChartBar as ChartBarIcon,
Folder as FolderIcon,
Inbox as InboxIcon,
PanelLeftClose as PanelLeftCloseIcon,
PanelLeftOpen as PanelLeftOpenIcon,
Settings as SettingsIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
const nav = [
{ label: "Inbox", icon: InboxIcon },
{ label: "Projects", icon: FolderIcon },
{ label: "Reports", icon: ChartBarIcon },
{ label: "Settings", icon: SettingsIcon },
]
export function SidebarCollapseToggle() {
const [collapsed, setCollapsed] = React.useState(false)
return (
<div className="flex h-56 w-full max-w-sm border">
<aside
className={cn(
"flex flex-col gap-1 border-e p-2 transition-all",
collapsed ? "w-12" : "w-40"
)}
>
{nav.map((n) => (
<Button
key={n.label}
variant="ghost"
size="sm"
className={cn("justify-start", collapsed && "justify-center px-0")}
aria-label={n.label}
>
<n.icon />
{!collapsed && n.label}
</Button>
))}
</aside>
<div className="flex flex-1 flex-col gap-2 p-3">
<Toggle
size="sm"
pressed={collapsed}
onPressedChange={setCollapsed}
aria-label="Collapse sidebar"
className="self-start"
>
{collapsed ? <PanelLeftOpenIcon /> : <PanelLeftCloseIcon />}
</Toggle>
<p className="text-xs text-muted-foreground">Main content area</p>
</div>
</div>
)
}
toggle-32
"use client"
import * as React from "react"
import {
Star as StarIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const initial = [
{
id: 1,
from: "Ali Imam",
subject: "Brand identity proposal attached",
starred: true,
},
{ id: 2, from: "Billing", subject: "Your Designali receipt", starred: false },
{
id: 3,
from: "Designali Studio",
subject: "New blocks are live on designali.com",
starred: false,
},
]
export function StarredEmailToggles() {
const [mail, setMail] = React.useState(initial)
const [onlyStarred, setOnlyStarred] = React.useState(false)
const visible = onlyStarred ? mail.filter((m) => m.starred) : mail
return (
<div className="w-full max-w-sm border">
<div className="flex items-center justify-between border-b px-3 py-1.5">
<span className="text-xs font-medium text-muted-foreground">Inbox</span>
<Toggle
size="sm"
pressed={onlyStarred}
onPressedChange={setOnlyStarred}
>
<StarIcon />
Starred only
</Toggle>
</div>
{visible.map((m) => (
<div
key={m.id}
className="flex items-center gap-2 border-b px-2 py-2 last:border-b-0"
>
<Toggle
size="sm"
pressed={m.starred}
onPressedChange={(starred) =>
setMail((prev) =>
prev.map((x) => (x.id === m.id ? { ...x, starred } : x))
)
}
aria-label="Star"
className="aria-pressed:bg-transparent aria-pressed:text-primary"
>
<StarIcon className="group-aria-pressed/toggle:fill-current" />
</Toggle>
<div className="min-w-0">
<p className="text-sm font-medium">{m.from}</p>
<p className="truncate text-xs text-muted-foreground">
{m.subject}
</p>
</div>
</div>
))}
</div>
)
}
toggle-33
"use client"
import * as React from "react"
import {
Focus as FocusIcon,
SpellCheck as SpellCheckIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip"
export function TooltipStateToggle() {
const [spell, setSpell] = React.useState(true)
const [focus, setFocus] = React.useState(false)
return (
<div className="flex items-center gap-1 border p-1">
<Tooltip>
<TooltipTrigger
render={
<Toggle
size="sm"
pressed={spell}
onPressedChange={setSpell}
aria-label="Spellcheck"
/>
}
>
<SpellCheckIcon />
</TooltipTrigger>
<TooltipContent>
{spell ? "Spellcheck on" : "Spellcheck off"}
</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger
render={
<Toggle
size="sm"
pressed={focus}
onPressedChange={setFocus}
aria-label="Focus mode"
/>
}
>
<FocusIcon />
</TooltipTrigger>
<TooltipContent>
{focus ? "Exit focus mode" : "Enter focus mode"}
</TooltipContent>
</Tooltip>
</div>
)
}
toggle-34
"use client"
import * as React from "react"
import {
MoonStar as MoonStarIcon,
} from "@designali/icons"
import { Kbd, KbdGroup } from "@/components/ui/kbd"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function KeyboardShortcutToggle() {
const [zen, setZen] = React.useState(false)
React.useEffect(() => {
function onKey(e: KeyboardEvent) {
if (e.altKey && e.key.toLowerCase() === "z") {
e.preventDefault()
setZen((v) => !v)
}
}
window.addEventListener("keydown", onKey)
return () => window.removeEventListener("keydown", onKey)
}, [])
return (
<div className="flex w-full max-w-xs flex-col gap-3 border p-4">
<div className="flex items-center justify-between gap-2">
<Toggle variant="outline" pressed={zen} onPressedChange={setZen}>
<MoonStarIcon />
Zen mode
</Toggle>
<KbdGroup>
<Kbd>Alt</Kbd>
<Kbd>Z</Kbd>
</KbdGroup>
</div>
<p className={cn("text-sm transition-opacity", zen && "opacity-30")}>
Sidebar, comments and toolbars {zen ? "are hidden" : "are visible"}.
</p>
</div>
)
}
toggle-35
"use client"
import * as React from "react"
import { Badge } from "@/components/ui/badge"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
const items = [
{ text: "Ali commented on Designali brand refresh", unread: true },
{ text: "Your icon export finished", unread: false },
{ text: "A client requested access to the Figma file", unread: true },
{ text: "Weekly studio summary is ready", unread: false },
]
export function UnreadOnlyBadgeToggle() {
const [unreadOnly, setUnreadOnly] = React.useState(false)
const unread = items.filter((i) => i.unread).length
const list = unreadOnly ? items.filter((i) => i.unread) : items
return (
<div className="w-full max-w-sm border">
<div className="flex items-center justify-between border-b px-3 py-1.5">
<span className="text-sm font-medium">Notifications</span>
<Toggle
size="sm"
variant="outline"
pressed={unreadOnly}
onPressedChange={setUnreadOnly}
>
Unread only
<Badge className="ms-1 h-4 min-w-4 px-1 text-[10px]">{unread}</Badge>
</Toggle>
</div>
{list.map((i) => (
<p
key={i.text}
className="flex items-center gap-2 border-b px-3 py-2 text-sm last:border-b-0"
>
<span
className={cn(
"size-1.5 shrink-0 rounded-full",
i.unread ? "bg-primary" : "bg-transparent"
)}
/>
{i.text}
</p>
))}
</div>
)
}
toggle-36
"use client"
import * as React from "react"
import {
EyeOff as EyeOffIcon,
Globe as GlobeIcon,
} from "@designali/icons"
import { Spinner } from "@/components/ui/spinner"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
function savePreference(on: boolean) {
return new Promise<void>((resolve, reject) =>
setTimeout(
() =>
Math.random() > 0.3 ? resolve() : reject(new Error(on ? "on" : "off")),
900
)
)
}
export function OptimisticAsyncToggle() {
const [pressed, setPressed] = React.useState(false)
const [saving, setSaving] = React.useState(false)
const [error, setError] = React.useState(false)
async function change(next: boolean) {
setPressed(next)
setSaving(true)
setError(false)
try {
await savePreference(next)
} catch {
setPressed(!next)
setError(true)
} finally {
setSaving(false)
}
}
return (
<div className="flex w-full max-w-xs flex-col gap-2 border p-4">
<div className="flex items-center justify-between">
<span className="text-sm">Public profile</span>
<Toggle
variant="outline"
size="sm"
pressed={pressed}
onPressedChange={change}
disabled={saving}
>
{saving ? <Spinner /> : pressed ? <GlobeIcon /> : <EyeOffIcon />}
{pressed ? "Public" : "Private"}
</Toggle>
</div>
<p
className={cn(
"text-xs",
error ? "text-destructive" : "text-muted-foreground"
)}
>
{error
? "Could not save. Your previous setting was restored."
: saving
? "Saving..."
: "Changes save automatically."}
</p>
</div>
)
}
toggle-37
"use client"
import * as React from "react"
import {
SquareCheck as SquareCheckIcon,
Square as SquareIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Toggle } from "@/components/ui/toggle"
export function InvalidConsentToggle() {
const [agreed, setAgreed] = React.useState(false)
const [submitted, setSubmitted] = React.useState(false)
const invalid = submitted && !agreed
return (
<form
className="flex w-full max-w-xs flex-col gap-3 border p-4"
onSubmit={(e) => {
e.preventDefault()
setSubmitted(true)
}}
>
<p className="text-sm font-medium">Before you publish</p>
<Toggle
variant="outline"
pressed={agreed}
onPressedChange={setAgreed}
aria-invalid={invalid || undefined}
aria-describedby="consent-error"
className="justify-start"
>
{agreed ? <SquareCheckIcon /> : <SquareIcon />}I own the rights to this
content
</Toggle>
{invalid && (
<p id="consent-error" className="text-xs text-destructive">
You need to confirm this to publish.
</p>
)}
<Button type="submit">
{submitted && agreed ? "Published" : "Publish"}
</Button>
</form>
)
}
toggle-38
"use client"
import * as React from "react"
import {
Languages as LanguagesIcon,
} from "@designali/icons"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Toggle } from "@/components/ui/toggle"
export function MessageTranslateToggle() {
const [translated, setTranslated] = React.useState(false)
return (
<div className="flex w-full max-w-sm gap-3">
<Avatar>
<AvatarFallback>LM</AvatarFallback>
</Avatar>
<div className="flex min-w-0 flex-col gap-1">
<div className="bg-muted px-3 py-2 text-sm">
{translated
? "Can we move the call to Thursday morning?"
: "On peut décaler l'appel à jeudi matin ?"}
</div>
<div className="flex items-center gap-2 text-xs text-muted-foreground">
<span>Client - 10:42</span>
<Toggle
size="sm"
pressed={translated}
onPressedChange={setTranslated}
className="h-6 px-1.5 text-xs"
>
<LanguagesIcon />
{translated ? "Show original" : "Translate"}
</Toggle>
</div>
</div>
</div>
)
}
toggle-39
"use client"
import * as React from "react"
import {
CircleCheck as CircleCheckIcon,
} from "@designali/icons"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function ResolveCommentToggle() {
const [resolved, setResolved] = React.useState(false)
return (
<div
className={cn(
"flex w-full max-w-sm flex-col gap-2 border p-3 transition-opacity",
resolved && "bg-muted/40"
)}
>
<div className="flex items-center gap-2">
<Avatar size="sm">
<AvatarFallback>AI</AvatarFallback>
</Avatar>
<span className="flex-1 text-sm font-medium">Ali Imam</span>
<Toggle
size="sm"
variant="outline"
pressed={resolved}
onPressedChange={setResolved}
>
<CircleCheckIcon />
{resolved ? "Resolved" : "Resolve"}
</Toggle>
</div>
{!resolved && (
<p className="text-sm text-muted-foreground">
The Designali hero copy feels too long on mobile. Could we cut the second
sentence?
</p>
)}
{resolved && (
<p className="text-xs text-muted-foreground">Thread resolved by you</p>
)}
</div>
)
}
toggle-40
"use client"
import * as React from "react"
import {
Lock as LockIcon,
LockOpen as LockOpenIcon,
ShieldCheck as ShieldCheckIcon,
Shield as ShieldIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function EncryptionLockToggle() {
const [encrypted, setEncrypted] = React.useState(false)
return (
<div className="flex w-full max-w-sm items-center gap-3 border p-4">
<div
className={cn(
"flex size-10 shrink-0 items-center justify-center",
encrypted
? "bg-primary/15 text-primary"
: "bg-muted text-muted-foreground"
)}
>
{encrypted ? (
<ShieldCheckIcon className="size-5" />
) : (
<ShieldIcon className="size-5" />
)}
</div>
<div className="min-w-0 flex-1">
<p className="text-sm font-medium">End-to-end encryption</p>
<p className="text-xs text-muted-foreground">
{encrypted
? "Only invited Designali clients can decrypt."
: "Files are encrypted at rest only."}
</p>
</div>
<Toggle
variant="outline"
pressed={encrypted}
onPressedChange={setEncrypted}
aria-label="End-to-end encryption"
>
{encrypted ? <LockIcon /> : <LockOpenIcon />}
</Toggle>
</div>
)
}
toggle-41
"use client"
import * as React from "react"
import {
DoorClosed as DoorClosedIcon,
Fan as FanIcon,
Lightbulb as LightbulbIcon,
Thermometer as ThermometerIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const devices = [
{ name: "Studio lights", icon: LightbulbIcon, on: true },
{ name: "Studio fan", icon: FanIcon, on: false },
{ name: "Heating", icon: ThermometerIcon, on: true },
{ name: "Studio door", icon: DoorClosedIcon, on: false },
]
export function SmartHomeDeviceTiles() {
const [state, setState] = React.useState(devices.map((d) => d.on))
return (
<div className="flex w-full max-w-xs flex-col gap-2">
<p className="text-xs text-muted-foreground">
{state.filter(Boolean).length} of {devices.length} devices on
</p>
<div className="grid grid-cols-2 gap-2">
{devices.map((d, i) => (
<Toggle
key={d.name}
variant="outline"
pressed={state[i]}
onPressedChange={(on) =>
setState((prev) => prev.map((v, j) => (j === i ? on : v)))
}
className="h-auto flex-col items-start gap-3 p-3 aria-pressed:border-primary aria-pressed:bg-primary aria-pressed:text-primary-foreground"
>
<d.icon className="size-5" />
<span className="flex w-full justify-between">
<span>{d.name}</span>
<span className="opacity-70">{state[i] ? "On" : "Off"}</span>
</span>
</Toggle>
))}
</div>
</div>
)
}
toggle-42
"use client"
import * as React from "react"
import {
CircleCheck as CircleCheckIcon,
Circle as CircleIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
const initialTasks = [
{ id: 1, title: "Send brand identity proposal", done: true },
{ id: 2, title: "Design homepage in Figma", done: false },
{ id: 3, title: "Build site with Next.js", done: false },
]
export function TaskCompleteToggles() {
const [tasks, setTasks] = React.useState(initialTasks)
return (
<div className="flex w-full max-w-xs flex-col border">
<div className="border-b px-3 py-2 text-xs font-medium text-muted-foreground">
Client project - {tasks.filter((t) => t.done).length}/{tasks.length}
</div>
{tasks.map((t) => (
<div
key={t.id}
className="flex items-center gap-2 border-b px-2 py-1.5 last:border-b-0"
>
<Toggle
size="sm"
pressed={t.done}
onPressedChange={(done) =>
setTasks((prev) =>
prev.map((x) => (x.id === t.id ? { ...x, done } : x))
)
}
aria-label={"Complete " + t.title}
className="aria-pressed:bg-transparent aria-pressed:text-primary"
>
{t.done ? <CircleCheckIcon /> : <CircleIcon />}
</Toggle>
<span
className={cn(
"text-sm",
t.done && "text-muted-foreground line-through"
)}
>
{t.title}
</span>
</div>
))}
</div>
)
}
toggle-43
"use client"
import * as React from "react"
import {
Eye as EyeIcon,
EyeOff as EyeOffIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
export function MaskBalanceToggle() {
const [hidden, setHidden] = React.useState(false)
return (
<div className="flex w-full max-w-xs flex-col gap-3 border bg-gradient-to-br from-muted/60 to-background p-5">
<div className="flex items-center justify-between">
<span className="text-xs font-medium text-muted-foreground">
Designali studio account
</span>
<Toggle
size="sm"
pressed={hidden}
onPressedChange={setHidden}
aria-label={hidden ? "Show balance" : "Hide balance"}
>
{hidden ? <EyeOffIcon /> : <EyeIcon />}
</Toggle>
</div>
<p className="text-3xl font-semibold tabular-nums">
{hidden ? "€ ••••••" : "€ 12,480.55"}
</p>
<p className="text-xs text-muted-foreground">
{hidden ? "•••• •••• •••• ••••" : "DE89 3704 0044 0532 0130 00"}
</p>
</div>
)
}
toggle-44
"use client"
import * as React from "react"
import {
Eye as EyeIcon,
EyeOff as EyeOffIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function SpoilerRevealToggle() {
const [revealed, setRevealed] = React.useState(false)
return (
<div className="flex w-full max-w-sm flex-col gap-2 border p-4">
<div className="flex items-center justify-between">
<span className="text-sm font-medium">Review: The Glass Orchard</span>
<Toggle
size="sm"
variant="outline"
pressed={revealed}
onPressedChange={setRevealed}
>
{revealed ? <EyeIcon /> : <EyeOffIcon />}
Spoilers
</Toggle>
</div>
<p
className={cn(
"text-sm text-muted-foreground transition",
!revealed && "blur-sm select-none"
)}
aria-hidden={!revealed}
>
The next Designali drop ships 50 new blocks and a fresh set of
@designali/icons for the dashboard templates.
</p>
</div>
)
}
toggle-45
"use client"
import * as React from "react"
import {
ChevronRight as ChevronRightIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import { Toggle } from "@/components/ui/toggle"
const items = [
{ name: "Designali Templates", qty: 2, price: "$36.00" },
{ name: "UI Blocks (lifetime)", qty: 1, price: "$18.00" },
]
export function ExpandableRowToggle() {
const [open, setOpen] = React.useState(false)
return (
<div className="w-full max-w-sm border">
<div className="flex items-center gap-2 px-3 py-2">
<Toggle
size="sm"
pressed={open}
onPressedChange={setOpen}
aria-label={open ? "Collapse order" : "Expand order"}
aria-expanded={open}
>
<ChevronRightIcon className="transition-transform group-aria-pressed/toggle:rotate-90" />
</Toggle>
<span className="flex-1 font-sans text-xs">#ORD-7721</span>
<Badge variant="secondary">Shipped</Badge>
<span className="text-sm tabular-nums">$54.00</span>
</div>
{open && (
<div className="border-t bg-muted/30 px-3 py-2">
{items.map((i) => (
<div key={i.name} className="flex justify-between py-1 text-xs">
<span>
{i.qty} x {i.name}
</span>
<span className="tabular-nums">{i.price}</span>
</div>
))}
</div>
)}
</div>
)
}
toggle-46
"use client"
import * as React from "react"
import {
Search as SearchIcon,
VenetianMask as VenetianMaskIcon,
} from "@designali/icons"
import { Input } from "@/components/ui/input"
import { Toggle } from "@/components/ui/toggle"
export function IncognitoSearchToggle() {
const [privateMode, setPrivateMode] = React.useState(false)
return (
<div className="flex w-full max-w-sm flex-col gap-2">
<div className="flex items-center gap-2">
<div className="relative flex-1">
<SearchIcon className="absolute start-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
<Input placeholder="Search docs" className="ps-8" />
</div>
<Toggle
variant="outline"
pressed={privateMode}
onPressedChange={setPrivateMode}
aria-label="Private search"
className="h-10 min-w-10"
>
<VenetianMaskIcon />
</Toggle>
</div>
<p className="text-xs text-muted-foreground">
{privateMode
? "Private search: nothing you type here is saved."
: "Recent searches are saved to this device."}
</p>
</div>
)
}
toggle-47
"use client"
import * as React from "react"
import {
ALargeSmall as ALargeSmallIcon,
Contrast as ContrastIcon,
CirclePause as PauseCircleIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function AccessibilityPreferenceToggles() {
const [large, setLarge] = React.useState(false)
const [contrast, setContrast] = React.useState(false)
const [motion, setMotion] = React.useState(false)
return (
<div className="flex w-full max-w-sm flex-col gap-3 border p-4">
<div className="flex flex-wrap gap-2">
<Toggle
variant="outline"
size="sm"
pressed={large}
onPressedChange={setLarge}
>
<ALargeSmallIcon />
Larger text
</Toggle>
<Toggle
variant="outline"
size="sm"
pressed={contrast}
onPressedChange={setContrast}
>
<ContrastIcon />
High contrast
</Toggle>
<Toggle
variant="outline"
size="sm"
pressed={motion}
onPressedChange={setMotion}
>
<PauseCircleIcon />
Reduce motion
</Toggle>
</div>
<div
className={cn(
"border p-3",
contrast && "border-foreground bg-foreground text-background"
)}
>
<p className={cn("font-medium", large ? "text-lg" : "text-sm")}>
Your Designali call is confirmed
</p>
<p
className={cn(
large ? "text-base" : "text-xs",
contrast ? "text-background" : "text-muted-foreground"
)}
>
Tue, 14 Nov at 09:15 with Ali Imam
</p>
<div
className={cn(
"mt-2 h-1 w-1/2 bg-primary",
!motion && "animate-pulse"
)}
/>
</div>
</div>
)
}
toggle-48
import {
Funnel as FilterIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
const searches = [
{ label: "Open block requests", count: 14 },
{ label: "Assigned to me", count: 6 },
{ label: "Due this week", count: 3 },
]
export function SavedSearchToggleChips() {
return (
<div className="flex w-full max-w-sm flex-col gap-2 border p-4">
<p className="text-xs font-medium text-muted-foreground">
Saved searches
</p>
<div className="flex flex-wrap gap-2">
{searches.map((s, i) => (
<Toggle key={s.label} variant="outline" defaultPressed={i === 0}>
<FilterIcon data-icon="inline-start" />
{s.label}
<span
data-icon="inline-end"
className="text-muted-foreground tabular-nums"
>
{s.count}
</span>
</Toggle>
))}
</div>
</div>
)
}
toggle-49
"use client"
import * as React from "react"
import {
Circle as CircleIcon,
Square as SquareIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function RecordingToggle() {
const [recording, setRecording] = React.useState(false)
const [seconds, setSeconds] = React.useState(0)
React.useEffect(() => {
if (!recording) return
const id = setInterval(() => setSeconds((s) => s + 1), 1000)
return () => clearInterval(id)
}, [recording])
const time =
String(Math.floor(seconds / 60)).padStart(2, "0") +
":" +
String(seconds % 60).padStart(2, "0")
return (
<div className="flex items-center gap-3 border p-3">
<Toggle
variant="outline"
pressed={recording}
onPressedChange={(on) => {
if (on) setSeconds(0)
setRecording(on)
}}
className="aria-pressed:border-destructive aria-pressed:bg-destructive aria-pressed:text-white"
>
{recording ? (
<SquareIcon className="fill-current" />
) : (
<CircleIcon className="fill-destructive text-destructive" />
)}
{recording ? "Stop" : "Record"}
</Toggle>
<span
className={cn(
"font-sans text-sm tabular-nums",
!recording && "text-muted-foreground"
)}
>
{time}
</span>
</div>
)
}
toggle-50
"use client"
import * as React from "react"
import {
BookOpen as BookOpenIcon,
} from "@designali/icons"
import { Toggle } from "@/components/ui/toggle"
import { cn } from "@/lib/utils"
export function ReadingModeToggle() {
const [reader, setReader] = React.useState(false)
return (
<div className="flex w-full max-w-sm flex-col border">
<div className="flex items-center justify-between border-b px-3 py-1.5">
<span className="truncate text-xs text-muted-foreground">
field-notes.example/slow-mornings
</span>
<Toggle
size="sm"
pressed={reader}
onPressedChange={setReader}
aria-label="Reader mode"
>
<BookOpenIcon />
</Toggle>
</div>
<article
className={cn(
"p-4 transition-colors",
reader &&
"bg-primary/5 font-sans text-chart-5 dark:bg-primary/30 dark:text-chart-1"
)}
>
<h3 className={cn("font-semibold", reader ? "text-lg" : "text-sm")}>
Design se code tak
</h3>
<p
className={cn(
"mt-1 leading-relaxed",
reader ? "text-base" : "text-xs text-muted-foreground"
)}
>
Where thoughtful design meets production-ready code. I design and
build digital experiences that look great and work beautifully.
</p>
</article>
</div>
)
}
Sync and Backup are managed by your Designali studio admin.
New on designali.com: 4000+ icons in @designali/icons.
designali/icons
4000+ React icons from Designali
Dana Kim (you)
Release checklist
Ship 20 new blocks to designali.com/blocks
Client kickoff
Brand identity brief, moodboard, timeline
Icon set review
Review @designali/icons additions by Friday
Ali Imam
Design engineer at Designali
Merino crew sweater
$89.00
Redesign the designali.com pricing page
DES-142 - 23 comments
You will be notified about new replies.
Senior UI/UX Designer
Next.js Developer
Brand Identity Designer
Motion & 3D Artist
Night Drive
The Paper Lanterns
Design se code tak: our workflow
6 min read
Building blocks with Tailwind CSS
11 min read
Using @designali/icons in Next.js
4 min read
1export function formatPrice(cents: number, currency = 'EUR') {2 return new Intl.NumberFormat('de-DE', { style: 'currency', currency }).format(cents / 100)3}
| Invoice | Service | Amount |
|---|---|---|
| INV-301 | Brand identity | $1,240 |
| INV-302 | UI/UX design | $860 |
| INV-303 | Next.js website | $3,100 |
Amenities
What are you into?
Pick at least 3 topics to personalise your feed.
$20 / seat / month
Billed monthly. Cancel anytime.
MacBook mockup
$19
iMac mockup
$29
Studio Display mockup
$39
"Start by measuring the room twice, then cut once."
Main content area
Ali Imam
Brand identity proposal attached
Billing
Your Designali receipt
Designali Studio
New blocks are live on designali.com
Sidebar, comments and toolbars are visible.
Ali commented on Designali brand refresh
Your icon export finished
A client requested access to the Figma file
Weekly studio summary is ready
Changes save automatically.
The Designali hero copy feels too long on mobile. Could we cut the second sentence?
End-to-end encryption
Files are encrypted at rest only.
2 of 4 devices on
€ 12,480.55
DE89 3704 0044 0532 0130 00
The next Designali drop ships 50 new blocks and a fresh set of @designali/icons for the dashboard templates.
Recent searches are saved to this device.
Your Designali call is confirmed
Tue, 14 Nov at 09:15 with Ali Imam
Saved searches
Where thoughtful design meets production-ready code. I design and build digital experiences that look great and work beautifully.