Skip to content

Commit 71384a1

Browse files
committed
docs(swingset): stop documenting icon overrides as SVG-only
`appearance.icons` clones whatever element it is given; nothing requires an `svg`. The Icon tests override with a `span`.
1 parent b026b12 commit 71384a1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/swingset/src/stories/icon.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Set `placement` when the icon sits beside text inside a container. It adds no st
5151

5252
### Overriding a glyph
5353

54-
Pass `appearance.icons` to `MosaicProvider` to replace a glyph by name. The override is a plain element; Mosaic clones it with the resolved sizing `className` and `data-size`, keeping any class the element already had. The replacement only supplies its `viewBox` and paths.
54+
Pass `appearance.icons` to `MosaicProvider` to replace a glyph by name. The override is a plain element of any type, not just an `svg`; Mosaic clones it with the resolved sizing `className` and `data-size`, keeping any class the element already had. The replacement only supplies its own content.
5555

5656
<Story
5757
name='Override'

packages/swingset/src/stories/icon.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ export function Override() {
8787
<MosaicProvider
8888
appearance={{
8989
// Overrides are elements, not render functions: Mosaic injects its sizing className and
90-
// `data-size` into the element via cloneElement, so the replacement only needs its viewBox
91-
// + paths. Passing an element (vs a function) also lets overrides be supplied from a Server
92-
// Component, since elements serialize across the RSC boundary.
90+
// `data-size` into the element via cloneElement, so the replacement only supplies its own
91+
// content and need not be an `svg`. Passing an element (vs a function) also lets overrides
92+
// be supplied from a Server Component, since elements serialize across the RSC boundary.
9393
icons: {
9494
'chevron-right': (
9595
<svg

0 commit comments

Comments
 (0)