Edit Profile Dialog
revola/edit-profileFreeComponent
A responsive profile editing dialog with file upload and form inputs - drawer on mobile, modal on desktop.
Install it
npx shadcn@latest add https://revola.sameerjs.com/r/edit-profile.jsonSource
1"use client";23import { useId } from "react";4import Image from "next/image";56import { CheckIcon, ImagePlusIcon, XIcon } from "lucide-react";78import { Button } from "@/components/ui/button";9import { Input } from "@/components/ui/input";10import { Label } from "@/components/ui/label";11import {12 ResponsiveDialog,13 ResponsiveDialogClose,14 ResponsiveDialogContent,15 ResponsiveDialogDescription,16 ResponsiveDialogFooter,17 ResponsiveDialogHeader,18 ResponsiveDialogTitle,19 ResponsiveDialogTrigger,20} from "@/components/ui/revola";21import { Textarea } from "@/components/ui/textarea";2223import { useCharacterLimit } from "@/hooks/use-character-limit";24import { useFileUpload } from "@/hooks/use-file-upload";2526// Pretend we have initial image files27const initialBgImage = [28 {29 name: "extended-gradient-bg.png",30 size: 1528737,31 type: "image/png",32 url: "/extended-gradient.png",33 id: "profile-bg-123456789",34 },35];3637const initialAvatarImage = [38 {39 name: "original-avatar.jpg",40 size: 1528737,41 type: "image/jpeg",42 url: "/original-avatar.jpg",43 id: "avatar-123456789",44 },45];4647export default function EditProfileDialog() {48 const id = useId();4950 const maxLength = 180;51 const {52 value,53 characterCount,54 handleChange,55 maxLength: limit,56 } = useCharacterLimit({57 maxLength,58 initialValue: "Hey, I am Charlet, a Product Manager who loves building amazing products that delight users!",59 });6061 return (62 <ResponsiveDialog>63 <ResponsiveDialogTrigger asChild>64 <Button variant="outline" className="h-12 rounded-full px-6 capitalize">65 Edit profile66 </Button>67 </ResponsiveDialogTrigger>68 <ResponsiveDialogContent className="flex flex-col gap-0">69 <ResponsiveDialogHeader className="space-y-0 !p-0 text-left">70 <ResponsiveDialogTitle className="border-b px-6 py-4 text-base max-sm:pt-2">71 Edit profile72 </ResponsiveDialogTitle>73 </ResponsiveDialogHeader>74 <ResponsiveDialogDescription className="sr-only">75 Make changes to your profile here. You can change your photo and set a username.76 </ResponsiveDialogDescription>7778 <div className="overflow-y-auto">79 <ProfileBg />80 <Avatar />81 <div className="px-6 pb-6 pt-4">82 <form className="space-y-4">83 <div className="flex flex-col gap-4 sm:flex-row">84 <div className="flex-1 space-y-2">85// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from revola
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alert Dialogalert-dialog | revola | Components | Free | no deps | |
| Alert Dialog with Iconalert-dialog-with-icon | revola | Components | Free | 1 dep | |
| Change Plan Dialogchange-plan | revola | Components | Free | 1 dep | |
| Checkout Dialogcheckout | revola | Components | Free | 2 deps | |
| Credit Card Dialogcredit-card | revola | Components | Free | 2 deps | |
| Custom Scrollbar Dialogcustom-scrollbar | revola | Components | Free | no deps | |
| Delete Project Dialogdelete-project | revola | Components | Free | 1 dep | |
| Feedback Dialogfeedback | revola | Components | Free | no deps |
