Components
Action row
A full-width, structured action for a data list.
import { โฆ } from "@fungi.computer/caps/components/action-row";Mushroom list
import { ActionRow } from "@fungi.computer/caps/components/action-row";
export default function MushroomList() { return ( <div className="flex w-full max-w-sm flex-col gap-1"> <ActionRow icon={<span aria-hidden="true">๐</span>} label="Chanterelle" description="Golden, ridged, smells like apricots" trailing={<span className="text-xs text-base-content">3 found</span>} /> <ActionRow icon={<span aria-hidden="true">๐</span>} label="Lion's mane" description="Shaggy white tufts on dead hardwood" trailing={<span className="text-xs text-base-content">1 found</span>} /> <ActionRow icon={<span aria-hidden="true">โ ๏ธ</span>} label="Death cap" description="Do not pick. Do not touch." variant="ghost-destructive" trailing={<span className="text-xs text-base-content">avoid</span>} /> </div> );}Density and appearance
import { ActionRow } from "@fungi.computer/caps/components/action-row";
export default function DensityAndAppearance() { return ( <div className="flex w-full max-w-sm flex-col gap-3"> <ActionRow density="compact" icon={<span aria-hidden="true">๐งบ</span>} label="Compact row" description="Tighter padding for dense lists" /> <ActionRow appearance="card" iconSize="lg" icon={<span aria-hidden="true">๐ฎ</span>} label="Card appearance" description="Molds itself into a raised plastic card" trailing={<span className="text-xs text-base-content">open</span>} /> </div> );}Selectable list
import { useState } from "react";import { ActionRow } from "@fungi.computer/caps/components/action-row";
const spots = ["Oak hollow", "Mossy ridge", "Creek bend"];
export default function SelectableList() { const [picked, setPicked] = useState(spots[0]); return ( <div className="flex w-full max-w-sm flex-col gap-1"> {spots.map((spot) => ( <ActionRow key={spot} icon={<span aria-hidden="true">๐</span>} label={spot} description={picked === spot ? "Today's spot" : undefined} trailing={picked === spot ? <span aria-hidden="true">โ</span> : null} onClick={() => { setPicked(spot); }} /> ))} </div> );}Props
ActionRowProps
| Prop | Type | Description |
|---|---|---|
icon? | ReactNode | |
label | ReactNode | |
description? | ReactNode | |
trailing? | ReactNode | |
density? | "regular" | | |
iconSize? | "default" | | lg gives a character-sized mark (a sprite head) more room than an icon. |
appearance? | "plain" | | card molds the row into its own raised plastic card. |
icon?ReactNodelabelReactNodedescription?ReactNodetrailing?ReactNodedensity?"regular" |"compact" iconSize?"default" |"lg" lg gives a character-sized mark (a sprite head) more room than an icon.
appearance?"plain" |"card" card molds the row into its own raised plastic card.
Full types: API reference.