{"name":"button-group","title":"Button Group","description":"","kind":"component","category":"actions","status":"beta","props":{"orientation":{"type":"enum","values":["horizontal","vertical"],"default":"horizontal"},"label":{"type":"string","description":"The group's accessible name (aria-label)."},"items":{"type":"array","description":"Buttons as data, rendered before the children: { value, label, disabled? }. A click calls onItemClick(value)."},"variant":{"type":"enum","values":["outline","primary","secondary","ghost"],"default":"outline","part":"item","description":"The Button variant of the items (children set their own)."},"size":{"type":"enum","values":["xs","sm","md","lg"],"default":"md","part":"item","description":"The Button size of the items: xs 24px, sm 28px, md 32px, lg 36px."},"shape":{"type":"enum","values":["pill","rounded"],"part":"item","description":"The Button shape of the items. Left out, the app's shape: a pill, or rounded in a rounded app (\"shape\": \"rounded\" in the project's fndn.json). Named: pill (the group's outer ends are round) or rounded."}},"playground":{"name":"Playground","props":{"label":"Export usage as","orientation":"horizontal","variant":"outline","size":"md","shape":"pill","items":[{"value":"csv","label":"CSV"},{"value":"json","label":"JSON"},{"value":"pdf","label":"PDF"}]}},"exampleFiles":[{"file":"merge-pull-request","title":"Merge, with more ways in a menu"},{"file":"members-pager","title":"Previous and next page"},{"file":"undo-redo","title":"Undo and redo, icon-only"},{"file":"export-usage","title":"Export formats, from items"},{"file":"deploy-actions","title":"Deploy actions in a side panel (vertical)"}],"worstCase":[{"name":"Long labels in a narrow row","width":220,"props":{"label":"Actions","items":[{"value":"a","label":"Reconcile every supplier invoice"},{"value":"b","label":"Flag mismatches"}]}},{"name":"One item","props":{"label":"Alone","items":[{"value":"a","label":"A"}]}},{"name":"Many items","width":320,"props":{"label":"Pages","size":"sm","items":[{"value":"1","label":"1"},{"value":"2","label":"2"},{"value":"3","label":"3"},{"value":"4","label":"4"},{"value":"5","label":"5"},{"value":"6","label":"6"},{"value":"7","label":"7"},{"value":"8","label":"8"},{"value":"9","label":"9"},{"value":"10","label":"10"},{"value":"11","label":"11"},{"value":"12","label":"12"}]}},{"name":"Right-to-left","props":{"label":"السجل","items":[{"value":"undo","label":"تراجع"},{"value":"redo","label":"إعادة"},{"value":"history","label":"السجل"}]}},{"name":"No items","props":{"label":"Empty","items":[]}}],"anatomy":[{"part":"root","element":"div","description":"role=group with an aria-label; an inline flex row (a column when vertical) with no gap. Its direct children lose the radius of their inner corners (logical: start and end, mirrored right-to-left; top and bottom when vertical). Each child's ring overlaps the previous child's edge, so a join is one 1px hairline. A focused child (and the pressed one) sits above its neighbours. Vertical: children stretch to the widest and use radius.control (a pill cannot be split top to bottom)."},{"part":"item","element":"button","optional":true,"repeat":true,"description":"A Button made from the items prop, marked data-button-group=\"item\"; it takes the group's variant, size and shape."}],"slots":{"default":"Buttons, Toggles or a Menu with its trigger, after the items."},"events":{"itemClick":"(value: string) after a click on an item"},"states":[],"tokens":[],"a11y":{"role":"group","keyboard":["Tab reaches each button in turn (a group is not a single tab stop: it is several actions, not one choice)","Enter / Space activate the focused button"],"notes":["Give the group a label that names what its buttons act on (\"Text alignment\", \"Merge options\").","Icon-only buttons in it still need their own name (tooltip or aria-label)."]},"motion":["press: the boxes stay still. A joined button never scales (the join would open) and the group is not scaled either; the pressed button's label and icon dip inside it (motion.press-scale-sm over duration.press), from the pointer only","hover: the Buttons' own fills over duration.fast (pointer only)","the group adds no motion"]}