# create_button

Creates a button. Values passed in `data` travel inside the `custom_id` and come back on click.

`from discord_interactions import create_button`

```python
def create_button(
    custom_id: str = '',
    label: str = '',
    style: str | int = 1,
    emoji: str | Dict[str, Any] | Any | None = None,
    data: Dict[str, Any] | None = None,
    disabled: bool = False,
    url: str | None = None,
    sku_id: int | str | None = None,
    component_id: int | None = None,
) -> Dict[str, Any]
```

- `custom_id`: Base identifier, sent back on click. Must be unique within the message.
- `label`: Button text (80 characters max).
- `style`: Style: a name (`"primary"`, `"success"`, `"danger"`) or a `ButtonStyle` number.
- `emoji`: Unicode emoji, custom emoji `"<:name:id>"`, dict or `discord.PartialEmoji`.
- `data`: JSON dict embedded in the `custom_id` (100 characters in total).
- `disabled`: Greyed out and not clickable.
- `url`: External link: the button becomes a Link button.
- `sku_id`: SKU to purchase: the button becomes a Premium button.
- `component_id`: Optional numeric identifier, unique within the message.

```python
from discord_interactions import create_action_row, create_button

button = create_button(
    "buy",
    "Buy",
    style="success",
    emoji="<:coin:123456789012345678>",
    data={"item": 42},
)
await ctx.respond("Shop", components=[create_action_row(button)])
```
