Button Group - React
Button Group
import { ButtonGroup } from '@idds/react';Contoh Penggunaan
Section titled “Contoh Penggunaan”Contoh 1 - Basic ButtonGroup
Section titled “Contoh 1 - Basic ButtonGroup”Pilih Tema
Default
Selected: month
Selected: grid
Selected: all
Contoh 2 - ButtonGroup with Features
Section titled “Contoh 2 - ButtonGroup with Features”Icon Options (Selected: center)
Custom Labels (Selected: option1)
Entire Group Disabled
Individual Option Disabled (Selected: option1)
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
options | ButtonGroupOption[] | — | Yes | Array of options to display. Setiap option memiliki value (string | number), label (ReactNode), dan disabled (boolean, opsional). |
value? | string | number | — | No | Nilai yang sedang dipilih (controlled mode). |
defaultValue? | string | number | — | No | Nilai default yang dipilih (uncontrolled mode). |
onChange? | (value: string | number) => void | — | No | Callback yang dipanggil ketika selection berubah. |
disabled? | boolean | false | No | Nonaktifkan seluruh button group. |
className? | string | — | No | ClassName tambahan untuk container button group. |
name? | string | — | No | HTML name attribute untuk form submission. |