Metadata-Version: 2.4
Name: st-segmented-buttons
Version: 0.1.0
Summary: A Streamlit custom component for segmented button controls with rich text support
Home-page: https://github.com/yourusername/st-segmented-buttons
Author: Your Name
Author-email: your.email@example.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: streamlit>=0.63
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# st-segmented-buttons

A customizable segmented button component for Streamlit applications. Create button groups with rich text, icons, and styling options.

## Installation

```bash
pip install st-segmented-buttons
```

## Quick start

```python
import streamlit as st
from st_segmented_buttons import segmented_buttons

# Simple example
selection = segmented_buttons(
    ["Option A", "Option B", "Option C"],
    default="Option A",
    key="simple_buttons"
)

if selection:
    st.write(f"You selected: {selection}")
```

### Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `buttons` | `List[Union[str, Dict]]` | Required | Button definitions |
| `default` | `Union[str, List[str]]` | `None` | Default selection(s) |
| `multiselect` | `bool` | `False` | Enable multiple selection |
| `color` | `str` | `"#484853"` | Text color (unselected) |
| `background_color` | `str` | `"#ffffff"` | Background color (unselected) |
| `selected_color` | `str` | `"#106a6c"` | Text color (selected) |
| `selected_background_color` | `str` | `"#e9f1f0"` | Background color (selected) |
| `border_radius` | `str` | `"6px"` | Border radius |
| `border_width` | `str` | `"1px"` | Border width |
| `border_color` | `str` | `"#ebebeb"` | Border color (unselected) |
| `selected_border_color` | `str` | `"#106a6c"` | Border color (selected) |
| `shadow` | `str` | `"none"` | Box shadow CSS |
| `height` | `str` | `"40px"` | Button height |
| `font_size` | `str` | `"14px"` | Font size |
| `gap` | `str` | `"8px"` | Gap between buttons |
| `auto_stretch` | `bool` | `False` | Stretch to fill width |
| `key` | `str` | `None` | Streamlit component key |

### Button dictionary format

When using dictionaries for buttons:

```python
{
    "label": "Display Text",     # Required: HTML string
    "value": "return_value",     # Required: Return value
    "icon": "🎯",                # Optional: Icon/emoji
    "disabled": False            # Optional: Disable button
}
```

### Return values

- **Single select**: Returns selected value as `str` or `None`
- **Multi-select**: Returns list of selected values as `List[str]` or `[]`

## License

MIT License - see LICENSE file for details.
