Skip to main content

@microsoft/flipcard-react

React bindings for FlipCard. Ships two components — <FlipCard> for a single card and <FlipCardCatalog> for a grid — plus the renderable type definitions.

Install

npm install @microsoft/flipcard-react @microsoft/flipcard-core @microsoft/flipcard-themes

Requires React ≥ 18.

<FlipCard>

import { FlipCard } from '@microsoft/flipcard-react';
import '@microsoft/flipcard-themes/styles/light.css';

<FlipCard
asset={{
id: 'welcome',
category: 'teal',
theme: 'light',
design: { title: 'Hello FlipCard', summary: 'Click to flip.' },
manifest: { id: 'welcome', title: 'Welcome' },
}}
defaultState="front"
interactive
onFlip={(state) => console.log(state)}
/>

Props

PropTypeDescription
assetFlipCardRenderableAssetRequired. Combines design + manifest + category + theme.
defaultState'front' | 'back'Initial face. Defaults to 'front'.
interactivebooleanWhether clicking the card flips it. Defaults to true.
classNamestringOptional class merged onto the wrapper.
onFlip(state: FlipState) => voidFired whenever the face changes.

The component renders an Adaptive Card surface on the front and a structured manifest view on the back, themed via the design tokens you import.

<FlipCardCatalog>

A pre‑styled grid for browsing many cards at once.

import { FlipCardCatalog } from '@microsoft/flipcard-react';

<FlipCardCatalog
assets={[asset1, asset2, asset3]}
className="my-catalog"
/>

Props

PropTypeDescription
assetsFlipCardRenderableAsset[]The cards to render.
classNamestringOptional wrapper class.

Types

import type {
FlipCardAssetCategory, // 'teal' | 'navy' | 'gold' | 'green' | 'red' | 'plum' | 'slate'
FlipCardAssetTheme, // 'light' | 'dark' | 'midnight-sapphire'
FlipCardAssetDesign,
FlipCardRenderableAsset,
FlipCardRenderableManifest,
FlipCardProps,
FlipCardCatalogProps,
} from '@microsoft/flipcard-react';

See also