Documentation Index
Fetch the complete documentation index at: https://mintlify.com/omavashia2005/ai-tool-elements/llms.txt
Use this file to discover all available pages before exploring further.
ToolCard is the primary rendering component in ai-tool-elements. It accepts a Tool object and renders a shadcn/ui Card containing the tool’s logo, name, description, and — when provided — a typed list of fields. Two optional slots, actions and footer, let you attach buttons, badges, metadata, or any other React content without touching the card layout.
Import
Basic usage
Pass any named catalog export directly to thetool prop. Remember to import the bundled stylesheet once at your app entry point or layout.
Props
The tool object to render. All display data —
name, description, image, and fields — is read from this object. Accepts any value that satisfies the Tool type, including built-in catalog entries and custom tool definitions.Rendered inside the
CardAction slot in the top-right corner of the card header. Use this for buttons, badges, status indicators, or any interactive element you want aligned with the card title row.Rendered inside
CardFooter at the bottom of the card, separated from the content area by a top border. Use this for metadata, external links, timestamps, or connection status.Any additional props are spread directly onto the underlying
Card div. This includes className for custom Tailwind overrides, data-* attributes, aria-* attributes, and event handlers.With actions and footer
Rendering tool fields
Whentool.fields is provided, ToolCard automatically renders each field as a list item inside the card body. Each item displays the field’s label (falling back to name if no label is set), an optional description in muted text below it, and a Required or Optional badge aligned to the right.
tool.fields is absent or empty, the card content area is omitted entirely and the card renders only its header (and footer, if provided).
Rendering all catalog tools
toolCatalog is a typed readonly array of every built-in catalog entry. You can map over it to render the full catalog, or filter it to a subset before rendering.
Logo rendering
tool.image is optional. When present, it is one of two shapes defined by the ToolImage union type:
{ type: "svg"; content: string }— the raw SVG string is encoded as adata:image/svg+xmldata URL and used as the<img>src.{ type: "url"; src: string }— thesrcvalue is used directly.
size-10) with rounded-md corners and object-contain scaling. The alt attribute is intentionally left empty because the tool name in CardTitle already labels the card. If tool.image is not set, no image element is rendered.
ToolCard is a generic component typed as ToolCard<T extends Tool>. If you define a custom subtype of Tool with additional fields, the tool prop will be narrowed to your subtype — giving you full autocomplete and compile-time safety on any extra properties your subtype carries.