You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/components/metadata-index.mdx
+57-8Lines changed: 57 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,13 +62,62 @@ By default each list shows up to 15 values before revealing a "Show more" button
62
62
/>
63
63
```
64
64
65
+
Pass `limit={0}` to show all values at once with no toggle button.
66
+
67
+
```mdx {3}
68
+
<Index
69
+
label="Subject"
70
+
limit={0}
71
+
/>
72
+
```
73
+
74
+
### Sort Order
75
+
76
+
Values within each label group can be ordered alphabetically (the default) or by frequency — most common value first. Use `sortOrder="count"` to surface the most-used terms at the top.
77
+
78
+
```mdx {3}
79
+
<Index
80
+
label="Subject"
81
+
sortOrder="count"
82
+
/>
83
+
```
84
+
85
+
<Indexlabel="Subject"sortOrder="count" />
86
+
87
+
### Show Count
88
+
89
+
Pass `showCount` to display the number of items that carry each value alongside the term, e.g. `Nepal (6)`.
|`label`| string || Restrict the index to a single metadata label (case-insensitive match on the configured labels). |
117
+
|`metadata`| array | global | Optional override (array of `{label, values}`) to render a curated subset instead of the full set. |
118
+
|`limit`| number |`15`| Maximum number of values to show before revealing the toggle inside each `<dl>`. Pass `0` to show all values with no toggle. |
119
+
|`sortOrder`|`"alphabetically"`\|`"count"`|`"alphabetically"`| Order values alphabetically or by descending occurrence count. Sorting is applied before the limit, so the most relevant values are always visible first when using `"count"`. |
120
+
|`showCount`| boolean |`false`| When `true`, appends the occurrence count in parentheses after each value, e.g. `Nepal (6)`. |
121
+
|`expandLabel`| string |`Show more`| Text for the expand button when additional values are hidden. |
122
+
|`collapseLabel`| string |`Show less`| Text used after expanding the list. |
123
+
|`className`| string || Extra classes applied to the wrapping `<div>`. Each label always renders as its own `<dl>`. |
0 commit comments