MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Label

Function Label

packages/dev/s2-docs/pages/react-aria/home/ExampleApp.tsx:552–567  ·  view source on GitHub ↗
({
  color,
  icon,
  children
}: {
  color: keyof typeof labelStyles;
  icon: React.ReactNode;
  children: React.ReactNode;
})

Source from the content-addressed store, hash-verified

550};
551
552function Label({
553 color,
554 icon,
555 children
556}: {
557 color: keyof typeof labelStyles;
558 icon: React.ReactNode;
559 children: React.ReactNode;
560}) {
561 return (
562 <span
563 className={`${labelStyles[color]} text-xs rounded-full border px-2 flex items-center max-w-fit gap-1`}>
564 {icon} <span className="truncate capitalize">{children}</span>
565 </span>
566 );
567}
568
569const cycleIcon = <RefreshCw aria-hidden="true" className="w-4 h-4 shrink-0" />;
570function CycleLabel({cycle}: {cycle: string}) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected