()
| 39 | } |
| 40 | |
| 41 | export function ControlledExample() { |
| 42 | const [pressed, setPressed] = createSignal(false); |
| 43 | |
| 44 | return ( |
| 45 | <> |
| 46 | <ToggleButton |
| 47 | class={style["toggle-button"]} |
| 48 | aria-label="Mute" |
| 49 | pressed={pressed()} |
| 50 | onChange={setPressed} |
| 51 | > |
| 52 | {(state) => ( |
| 53 | <Show |
| 54 | when={state.pressed()} |
| 55 | fallback={<VolumeOnIcon class="h-6 w-6" />} |
| 56 | > |
| 57 | <VolumeOffIcon class="h-6 w-6" /> |
| 58 | </Show> |
| 59 | )} |
| 60 | </ToggleButton> |
| 61 | <p class="not-prose text-sm mt-2"> |
| 62 | The microphone is {pressed() ? "muted" : "active"}. |
| 63 | </p> |
| 64 | </> |
| 65 | ); |
| 66 | } |
nothing calls this directly
no outgoing calls
no test coverage detected