Action Box
solanaui/action-boxFreeComponent
A configurable action form with token input, detail rows, and submit button for DeFi operations like staking, lending, and closing positions.
Live preview
live · rendered by the registry
Rendered by solanaui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solanaui.dev/r/action-box.jsonSource
1import { TokenInput } from "@/registry/sol/token-input";2import { Button } from "@/components/ui/button";3import { Separator } from "@/components/ui/separator";4import type { DetailRow } from "@/registry/lib/types";5import { cn } from "@/lib/utils";67type ActionBoxDetail = DetailRow;89interface ActionBoxProps {10 tokens: { icon: string; symbol: string }[];11 defaultToken?: string;12 balance?: string;13 label?: string;14 details?: ActionBoxDetail[];15 submitLabel?: string;16 onSubmit?: () => void;17 className?: string;18}1920const ActionBox = ({21 tokens,22 defaultToken,23 balance,24 label,25 details,26 submitLabel = "Submit",27 onSubmit,28 className,29}: ActionBoxProps) => {30 return (31 <div className={cn("flex flex-col gap-4 border rounded-lg p-4", className)}>32 {label && (33 <span className="text-sm font-medium text-muted-foreground">34 {label}35 </span>36 )}37 <TokenInput38 tokens={tokens}39 defaultToken={defaultToken}40 balance={balance}41 />42 {details && details.length > 0 && (43 <>44 <Separator />45 <div className="flex flex-col gap-1.5 text-sm">46 {details.map((detail) => (47 <div key={detail.label} className="flex justify-between">48 <span className="text-muted-foreground">{detail.label}</span>49 <span className={detail.className}>{detail.value}</span>50 </div>51 ))}52 </div>53 </>54 )}55 <Button className="w-full" size="lg" onClick={onSubmit}>56 {submitLabel}57 </Button>58 </div>59 );60};6162export type { ActionBoxProps, ActionBoxDetail };63export { ActionBox };
What it pulls in
Other registry items
Files it writes
More from solanaui
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Feedactivity-feed | solanaui | Components | Free | 1 dep | |
| Address Displayaddress-display | solanaui | Components | Free | 1 dep | |
| Auth Cardauth-card | solanaui | Components | Free | no deps | |
| Health Barhealth-bar | solanaui | Components | Free | no deps | |
| Leverage Sliderleverage-slider | solanaui | Components | Free | no deps | |
| NFT Cardnft-card | solanaui | Components | Free | no deps | |
| Order Bookorder-book | solanaui | Components | Free | no deps | |
| Order Formorder-form | solanaui | Components | Free | 1 dep |
