Put the dice in the tray, then add the total and a trigger.
backgammon-turn.tsx
DiceRoll
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| on | — | Called when the dice come to rest, with their faces in the order the dice render. | |
| on | — | Called when a throw starts: a press on the tray or the trigger that the dice take. | |
| disabled | boolean | false | Stops new throws. A throw in the air still lands. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DiceRollTray
<button>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| style | CSSProperties | — | |
From Base UIButtonBase UI docs | |||
| focusable | boolean | false | Whether the button should be focusable when disabled. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| native | boolean | true | Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>). |
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. |
DiceRollDie
<span>DiceRollTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
DiceRollTotal
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
| EnterorSpace | Throws the dice when the tray or DiceRollTrigger has focus. A press while the dice roll does nothing. |
|---|
Built with
Installs with Dice Roll
- Components
- Button









