components/IconToggle
import { … } from 'zidane-ui'ui/src/components/IconToggle.tsx
Components#
IconToggleComponent#
Icon control for the panel toolbars, meant to sit in a .zg-segment
group (pressed = the raised chip). label doubles as the accessible name
and the tooltip (portalled: these sit in clipped rows). Keep it to a word
or two.
function IconToggle(props: IconToggleProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | IconToggleProps | Component props. |
Returns
ElementProps
| Name | Type | Default | Description |
|---|---|---|---|
| active | boolean | Whether the toggle is pressed. Shows the raised chip and sets | |
| badge? | string | Count next to the icon (changed-files toggle), in the meta voice. | |
| className? | string | Extra classes on the root element. | |
| icon | string | Icon class for the glyph, such as | |
| label | string | Accessible name and tooltip text. Keep it to a word or two. | |
| onClick | () => void | Called when the toggle is clicked. | |
| size? | 'xs' | 'sm' | 'sm' | Button height: |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
IconTogglePropsInterface#
Props for IconToggle.
interface IconTogglePropsProperties
| Name | Type | Default | Description |
|---|---|---|---|
| active | boolean | Whether the toggle is pressed. Shows the raised chip and sets | |
| badge? | string | Count next to the icon (changed-files toggle), in the meta voice. | |
| className? | string | Extra classes on the root element. | |
| icon | string | Icon class for the glyph, such as | |
| label | string | Accessible name and tooltip text. Keep it to a word or two. | |
| onClick | () => void | Called when the toggle is clicked. | |
| size? | 'xs' | 'sm' | 'sm' | Button height: |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |