Skip to main content
Version: Next

FavoriteToggle()

Home > @backstage/core-components > FavoriteToggle

Toggle encapsulating logic for marking something as favorite, primarily used in various instances of entity lists and cards but can be used elsewhere.

This component can only be used in as a controlled toggle and does not keep internal state.

Signature:

function FavoriteToggle(props: ComponentProps<typeof IconButton> & {
id: string;
title: string;
isFavorite: boolean;
onToggle: (value: boolean) => void;
}): React.JSX.Element;

Parameters

Parameter

Type

Description

props

ComponentProps<typeof IconButton> & { id: string; title: string; isFavorite: boolean; onToggle: (value: boolean) => void; }

**Returns:**

React.JSX.Element