indicator
efferd-/indicatorFreeComponent
Indicator component.
Live preview
live · rendered by the registry
Rendered by efferd on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add http://efferd.com/r/indicator.jsonSource
1import { cn } from "@/lib/utils";2import { cva, type VariantProps } from "class-variance-authority";3import type { ComponentProps } from "react";45const statusIndicatorVariants = cva(6 [7 "relative flex size-2 shrink-0 items-center justify-center rounded-full",8 "*:rounded-full *:bg-current",9 "[&_[data-slot=indicator-dot]]:size-[75%]",10 "[&_[data-slot=indicator-ping]]:absolute [&_[data-slot=indicator-ping]]:size-full",11 ],12 {13 variants: {14 color: {15 emerald: "text-emerald-500",16 rose: "text-rose-500",17 amber: "text-amber-500",18 sky: "text-sky-500",19 },20 pulse: {21 true: "[&_[data-slot=indicator-ping]]:animate-ping",22 false: "[&_[data-slot=indicator-ping]]:hidden",23 },24 },25 defaultVariants: {26 color: "emerald",27 pulse: true,28 },29 }30);3132export type StatusIndicatorProps = ComponentProps<"span"> &33 VariantProps<typeof statusIndicatorVariants>;3435export function StatusIndicator({36 className,37 color,38 pulse,39 ...props40}: StatusIndicatorProps) {41 return (42 <span43 className={cn(statusIndicatorVariants({ color, pulse }), className)}44 {...props}45 >46 <span aria-hidden data-slot="indicator-ping" />47 <span aria-hidden data-slot="indicator-dot" />48 </span>49 );50}
Files it writes
More from efferd
All 201 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| apple-iconapple-icon | efferd | Components | Free | no deps | |
| auth-dividerauth-divider | efferd | Components | Free | no deps | |
| copy-buttoncopy-button | efferd | Components | Free | no deps | |
| decor-icondecor-icon | efferd | Components | Free | no deps | |
| discord-icondiscord-icon | efferd | Components | Free | no deps | |
| facebook-iconfacebook-icon | efferd | Components | Free | no deps | |
| figma-iconfigma-icon | efferd | Components | Free | no deps | |
| formaterformater | efferd | Components | Free | no deps |
