MCPcopy Create free account
hub / github.com/kobaltedev/kobalte / DefaultPressedExample

Function DefaultPressedExample

apps/docs/src/examples/toggle-button.tsx:22–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22export function DefaultPressedExample() {
23 return (
24 <ToggleButton
25 class={style["toggle-button"]}
26 aria-label="Mute"
27 defaultPressed
28 >
29 {(state) => (
30 <Show
31 when={state.pressed()}
32 fallback={<VolumeOnIcon class="h-6 w-6" />}
33 >
34 <VolumeOffIcon class="h-6 w-6" />
35 </Show>
36 )}
37 </ToggleButton>
38 );
39}
40
41export function ControlledExample() {
42 const [pressed, setPressed] = createSignal(false);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected