Components
HeroUI v3 CloseButton — an accessible icon button for dismissing dialogs, drawers, alerts, chips and other transient UI. Renders a close (X) icon by default, accepts a custom icon via children, and exposes onPress, isDisabled and full React Aria button props with hover/press/focus render states. A thin re-export of the genuine @heroui/react package with @heroui/styles, so consumers install and render the real HeroUI primitive.
npx @21st-dev/cli@beta add hero_ui/heroui-close-buttonLoading preview...
"use client"
import { useState } from "react"
import { CloseButton } from "@/components/ui/heroui-close-button"
export default function Interactive() {
const [count, setCount] = useState(0)
return (
<div className="flex flex-col items-center justify-center gap-4">
<CloseButton
aria-label={`Close (clicked ${count} times)`}
onPress={() => setCount(count + 1)}
/>
<span className="text-sm text-muted-foreground">
Clicked: {count} times
</span>
</div>
)
}