@farcaster/snap@2.5.0
Minor Changes
-
#181
efaf84cThanks @bob-obringer! - Add shadcn-style media support to Snapitemrows.Items now accept an optional
props.mediaobject that renders in a dedicated left-side media slot while existingchildrencontinue to render in the right-side actions slot. Icon media uses{ variant: "icon", name, color? }; image media uses{ variant: "image", url, alt?, round? }, whereround: truerenders avatar-style circular image media.The snap UI catalog now exposes the expanded
itemschema throughitemPropsanditemMediaProps, including the new discriminatedmediacontract. The catalog keepsvariantlimited to"default"and does not add item sizes or media sizes, so clients continue to own the exact rendered dimensions. Catalog validation accepts icon media bynameplus optional palettecolor, accepts image media byurlplus optionalaltandround, and rejects unsupported media fields.The React and React Native renderers now support this item media slot, keep media and trailing actions vertically centered in compact rows, use smaller subtitle text for item descriptions, and remove horizontal row padding for plain lists while preserving modest inset for bordered item groups. Image media URLs are validated with the same HTTPS and loopback development rules as regular image elements.
This also adds a runnable
examples/item-mediaapp with real image media examples and updates the 2.0 item documentation and machine-readable guidance. -
#183
511528eThanks @bob-obringer! - AddcellAspectRatiosupport tocell_grid.cell_gridnow acceptscellAspectRatio: "square"to keep each cell square as snap width changes, while preserving the existingrowHeightbehavior by default. This makes board-style snaps such as Minesweeper render with stable cell geometry across client widths.The React, React Native, static HTML, and OG image renderers now honor square grid cells. The 2.0 docs, agent-facing skill text, and
llms.txtreference material document the new option, and a focusedcell-grid-squareexample app exercises the behavior in the emulator. -
#178
96ad223Thanks @bob-obringer! - Infer button-only stack and toggle group orientation from visible label content in the React and React Native components. The components render horizontally only when total visible label text fits these limits: 2 controls <= 20 chars, 3 controls <= 15 chars, 4 controls <= 11 chars, and 5 controls <= 8 chars. Six controls, or any button/toggle set over its limit, renders vertically.Button-only stacks now default to the
smgap whengapis omitted, regardless of whether the content resolves horizontal or vertical. Horizontal button-only stacks use content-proportional widths by default, andequalWidth: truecan be set on a horizontal stack to force equal-width children.