Action Button
wa-ui/action-buttonFreeComponent
WhatsApp-style outlined pill action button with optional icon, using @base-ui/react Button.
Live preview
live · rendered by the registry
Rendered by wa-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.meta-cloud-api.site/r/action-button.jsonSource
1"use client";23import * as React from "react";4import { Button } from "@base-ui/react/button";5import { cn } from "@/lib/utils";6import "@/components/ui/whatsapp/styles/whatsapp.css";78export interface ActionButtonProps {9 /** Icon element rendered before the label */10 icon?: React.ReactNode;11 children: React.ReactNode;12 /** Render as an anchor — base-ui render prop */13 href?: string;14 onClick?: () => void;15 className?: string;16}1718/**19 * WhatsApp-style outlined pill action button.20 *21 * @example22 * <ActionButton icon={<ViewMoreIcon />}>더 보기</ActionButton>23 * <ActionButton icon={<PlusIcon />} href="/channels/create">채널 만들기</ActionButton>24 */25const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>(26 ({ icon, children, href, onClick, className }, ref) => {27 const renderEl = href ? <a href={href} /> : undefined;2829 return (30 <Button31 ref={ref}32 render={renderEl}33 nativeButton={!href}34 onClick={onClick}35 className={cn(36 "font-wa inline-flex w-full items-center justify-center gap-2",37 "rounded-full border border-wa-emerald-500 px-4 py-[10px]",38 "text-[15px] font-medium text-wa-emerald-500",39 "transition-colors hover:bg-wa-emerald-500/10",40 className41 )}42 >43 {icon && <span className="shrink-0">{icon}</span>}44 {children}45 </Button>46 );47 }48);49ActionButton.displayName = "ActionButton";5051export { ActionButton };
What it pulls in
npm packages
Files it writes
More from wa-ui
All 29 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Call Permissioncall-permission | wa-ui | Components | Free | 1 dep · 2 files | |
| Carousel Templatecarousel-template | wa-ui | Components | Free | 1 dep · 3 files | |
| Chat Bubblechat-bubble | wa-ui | Components | Free | no deps · 2 files | |
| Chat Headerchat-header | wa-ui | Components | Free | no deps · 2 files | |
| Chat List Itemchat-list-item | wa-ui | Components | Free | no deps · 2 files | |
| Chat Menuchat-menu | wa-ui | Components | Free | 1 dep · 2 files | |
| Contact Bubblecontact-bubble | wa-ui | Components | Free | 1 dep · 3 files | |
| CTA URL Bubblecta-url-bubble | wa-ui | Components | Free | 1 dep · 3 files |
