RadioCard
Radio button card
import RadioCard from "@intility/bifrost-react/RadioCard";RadioCard
Go to top
For convenience, <RadioCard> is provided as an alias for
<CheckboxCard type="radio">. Otherwise, it functions
exactly the same as <CheckboxCard>.
Basic usage
TSX
<RadioCard name="radioDemo" label="Tasty walnut">
Tasty walnut pesto tart farro platter elderberry cookies Italian
pepperoncini cozy cinnamon oatmeal
</RadioCard>
<RadioCard name="radioDemo" label="Lemon">
Lemon red lentil soup dessert lemon tahini dressing golden cayenne
pepper springtime strawberry
</RadioCard>See <CheckboxCard> for more examples.
Inactive state
Use state="inactive" for a focusable, tooltip-friendly replacement for
disabled. The card chrome stays at full opacity; only the radio icon dims.
See <CheckboxCard> for the full pattern.
TSX
<RadioCard state="inactive" name="inactiveDemo" label="Inactive option">...</RadioCard>Sandbox
You can bind a RadioCard to a boolean state using the checked prop and update
your state every time the onChange event is triggered.
import { useState } from "react"; import RadioCard from "@intility/bifrost-react/RadioCard"; import AutoCol from "@intility/bifrost-react/AutoCol"; export default function RadioCardDemo() { const [selected, setSelected] = useState("Lemon"); return ( <AutoCol> <RadioCard name="radioDemo" label="Tasty walnut" checked={selected === "Tasty walnut"} onChange={() => setSelected("Tasty walnut")} > Tasty walnut pesto tart farro platter elderberry cookies Italian pepperoncini cozy cinnamon oatmeal </RadioCard> <RadioCard name="radioDemo" label="Lemon" checked={selected === "Lemon "} onChange={() => setSelected("Lemon ")} > Lemon red lentil soup dessert lemon tahini dressing golden cayenne pepper springtime strawberry </RadioCard> </AutoCol> ); }